-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathINSTALL
executable file
·43 lines (34 loc) · 1.3 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
if [ ! -d /var/cache/git ];then mkdir -p /var/cache/git; fi
(cd /var/cache/git ; git clone [email protected]:jarvis.git)
#if [ "$(sed -e 's/\..*//' /etc/debian_version)" == "6" ];then
# (cd /var/cache/git/jarvis ; git checkout squeeze; git pull origin squeeze )
#fi
(cd /var/cache/git/jarvis; ./get_dependencies)
install -m 0755 /var/cache/git/jarvis/bin/init-script /etc/init.d/jarvis
cat<<EOF> /etc/default/jarvis
# this is a bourne shell fragment.
RUN_AS='opt'
SECRET="\$(/usr/local/sbin/secret)"
LDAP_DOMAIN="\$(dnsdomainname)"
LDAP_BASEDN="dc=\$(echo \${LDAP_DOMAIN}|sed -e 's/\./,dc=/g')"
LDAP_BINDDN="cn=\$(hostname -s),ou=Hosts,\${LDAP_BASEDN}"
LDAP_PASSWD="\${SECRET}"
LDAP_PASSWORD="\${SECRET}"
XMPP_USERNAME="\$(hostname -s)@\$(dnsdomainname)"
XMPP_PASSWORD="\${SECRET}"
TWITTER_USERNAME=capncrunchbot
TWITTER_PASSWORD=z0mgTw1tt3r\!
GIT_ENABLED=1
GIT_SOURCE='gitosis@\$(hostname -f):jarvis.git'
GIT_ROOT='/var/cache/git'
GIT_REPO="\${GIT_ROOT}/jarvis"
LOG_FILE="/var/log/jarvis.log"
export LDAP_DOMAIN LDAP_BASEDN LDAP_BINDDN LDAP_PASSWD LDAP_PASSWORD \
XMPP_USERNAME XMPP_PASSWORD \
TWITTER_USERNAME TWITTER_PASSWORD \
GIT_ENABLED GIT_ROOT GIT_REPO \
SECRET
EOF
chmod 400 /etc/default/jarvis
/etc/init.d/jarvis restart; tail -f /var/log/jarvis.log