updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / icecream1 / icecream-scheduler-daemon
blob4946a07fd404ad31786eccc219facdcc64d1dd2b
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/icecream.conf
7 case "$1" in
8 start)
9 stat_busy "Starting Icecream Scheduler Daemon"
10 netname=
11 if test -n "$ICECREAM_NETNAME"; then
12 netname="-n $ICECREAM_NETNAME"
14 logfile=""
15 if test -n "$ICECREAM_LOG_FILE"; then
16 touch $ICECREAM_LOG_FILE
17 chown icecream:icecream $ICECREAM_LOG_FILE
18 logfile="-l $ICECREAM_LOG_FILE"
20 /opt/icecream/sbin/scheduler -d $netname $logfile &>/dev/null
21 if [ $? -gt 0 ]; then
22 stat_fail
23 else
24 add_daemon icecream-scheduler
25 stat_done
28 stop)
29 stat_busy "Stopping Icecream Scheduler Daemon"
30 killall /opt/icecream/sbin/scheduler > /dev/null 2>&1 || true
31 if [ $? -gt 0 ]; then
32 stat_fail
33 else
34 rm_daemon icecream-scheduler
35 stat_done
38 restart)
39 $0 stop
40 sleep 1
41 $0 start
44 echo "usage: $0 {start|stop|restart}"
45 esac
46 exit 0