updated on Sun Jan 15 04:04:02 UTC 2012
[aur-mirror.git] / sickbeard / sickbeard.init
blob5551010fc81ca21626e621ec67fb20270efbda63
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 case "$1" in
7 start)
8 stat_busy "Starting Sick Beard"
10 if [ -f /var/run/daemons/sickbeard ]; then
11 echo -n "Sick Beard is already running as a daemon!"
12 stat_fail
13 else
14 su - sickbeard -c "python2 /opt/sickbeard/SickBeard.py &> /dev/null &" -s /bin/sh
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon sickbeard
19 stat_done
23 stop)
24 stat_busy "Stopping Sick Beard"
26 curl -f http://localhost:8081/home/shutdown/ &> /dev/null
28 if [ $? -gt 0 ]; then
29 stat_fail
30 else
31 rm_daemon sickbeard
32 stat_done
35 restart)
36 $0 stop
37 sleep 1
38 $0 start
41 echo "usage: $0 {start|stop|restart}"
42 esac
43 exit 0