Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # *** Arch Linux Sick Beard RC script ***
- # Location: /etc/rc.d/sickbeard
- #
- . /etc/rc.conf
- . /etc/rc.d/functions
- . /etc/conf.d/sickbeard.conf
- case "$1" in
- start)
- stat_busy "Starting Sick-Beard"
- if [ -f $SB_PIDFILE ]; then
- stat_fail
- PID=`cat $SB_PIDFILE`
- echo "Sick-Beard is already running: $PID"
- else
- su - $SB_USER -c "$SB_PYTHON $SB_BIN -q -d --config $SB_CONF --port $SB_PORT --pidfile $SB_PIDFILE" -s /bin/sh
- if [ $? -gt 0 ]; then
- stat_fail
- else
- add_daemon sickbeard
- stat_done
- fi
- fi
- ;;
- stop)
- stat_busy "Stopping Sick-Beard"
- if [ -f $SB_PIDFILE ]; then
- PID=`cat $SB_PIDFILE`
- kill -TERM $PID
- rm_daemon sickbeard
- stat_done
- else
- stat_fail
- fi
- ;;
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement