updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / squeezebox-server / rc.d
blobe15f63da61d45ad7cfeb99bedbd454813dbaff3f
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 name=squeezebox-server
7 . /etc/conf.d/$name
8 prog="cd $SQUEEZEBOX_HOME; ./slimserver.pl $SQUEEZEBOX_ARGS"
10 PID=$(pgrep slimserver.pl)
12 case "$1" in
13 start)
14 stat_busy "Starting $name daemon"
15 [[ -z "$PID" ]] && eval $prog \
16 && { add_daemon $name; stat_done; } \
17 || { stat_fail; exit 1; }
19 stop)
20 stat_busy "Stopping $name daemon"
21 [[ -n "$PID" ]] && kill $PID &>/dev/null \
22 && { rm_daemon $name; stat_done; } \
23 || { stat_fail; exit 1; }
25 restart)
26 $0 stop
27 sleep 5
28 $0 start
31 echo "usage: $0 {start|stop|restart|reload}"
32 exit 1
34 esac