updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / disco / disco-master
blob0208dd630010a3f2634b44ccb5bda23729150d07
1 #!/bin/bash
3 # general config
4 . /etc/rc.conf
5 . /etc/rc.d/functions
7 . /etc/disco/disco.conf
9 case "$1" in
10 start)
11 stat_busy "Starting Disco Master"
12 disco-master &>/dev/null &
13 if [[ -n "$DISCO_MASTER_PORT" ]]; then
14 lighttpd -f /etc/disco/lighttpd-master.conf
16 if [ $? -gt 0 ]; then
17 stat_fail
18 else
19 add_daemon disco-master
20 stat_done
23 stop)
24 stat_busy "Stopping Disco Master"
25 if [[ -n "$DISCO_MASTER_PORT" ]]; then
26 kill $(cat /var/run/disco/disco-lighttpd.pid) &> /dev/null
28 kill $(cat /var/run/disco/disco-master.pid) &> /dev/null
29 if [ $? -gt 0 ]; then
30 stat_fail
31 else
32 rm_daemon disco-master
33 stat_done
36 restart)
37 $0 stop
38 sleep 1
39 $0 start
42 echo "usage: $0 {start|stop|restart}"
44 esac
45 exit 0