-
Notifications
You must be signed in to change notification settings - Fork 0
/
postinstallation.sh
30 lines (27 loc) · 1 KB
/
postinstallation.sh
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
#!/bin/sh
### BEGIN INIT INFO
# Provides: postinstallation
# Required-Start: $all
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: performs post installation tasks
# Description: installs adhocracy after debian installation
### END INIT INFO
case "$1" in
start)
aptitude -y install sudo && usermod -g sudo adhocracy
echo "adhocracy ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
su - adhocracy -c "wget -nv https://raw.github.com/liqd/adhocracy.buildout/master/build_debian.sh -O build_debian.sh && sh build_debian.sh @@@BUILD-PARAMETERS@@@"
cat >> /home/adhocracy/adhocracy_buildout/parts/supervisor/supervisord.conf <<EOF
[program:adhocracy]
command = /home/adhocracy/adhocracy_buildout/bin/paster serve /home/adhocracy/adhocracy_buildout/etc/adhocracy.ini
process_name = adhocracy
directory = /home/adhocracy/adhocracy_buildout/bin
priority = 45
redirect_stderr = false
EOF
update-rc.d -f postinstallation remove
halt
;;
esac