updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / rocrail-bzr / rc-rocrail
blobb5e49d51f5e3eb0fed412806baeb11933ed41e68
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=$(pidof -o %PPID /opt/rocrail/rocrail)
8 case $1 in
9 start)
10 stat_busy "Starting Rocrail Daemon"
11 if [[ -z $PID ]] && /opt/rocrail/rocraild.sh &>/dev/null; then
12 PID=$(pidof -o %PPID /opt/rocrail/rocrail)
13 echo "$PID" > /var/run/rocrail.pid
14 add_daemon rocrail
15 stat_done
16 else
17 stat_fail
18 exit 1
22 stop)
23 stat_busy "Stopping Rocrail Daemon"
24 if [[ ! -z $PID ]] && kill "$PID" &>/dev/null; then
25 rm_daemon rocrail
26 stat_done
27 else
28 stat_fail
29 exit 1
33 restart)
34 $0 stop
35 sleep 1
36 $0 start
40 echo "Usage: $0 {start|stop|restart}" >&2
41 exit 1
43 esac