Created
April 14, 2013 11:00
-
-
Save swissmanu/5382296 to your computer and use it in GitHub Desktop.
simple startup script for sabnzbd, couchpotato and sickbeard on a synology nas.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SABNZBD_CONFIG=/root/.sabnzbd/sabnzbd.ini | |
SABNZBD_HOST=--HOST_ADDRESS-- | |
SABNZBD_PORT=9200 | |
SABNZBD_APIKEY=--YOUR_API_KEY-- | |
CP_PID=/var/run/couchpotato.pid | |
CP_CONFIG=/usr/local/couchpotato.config.ini | |
CP_DATADIR=/root/.couchpotato | |
CP_PORT=9300 | |
SB_PID=/var/run/sickbeard.pid | |
SB_CONFIG=/usr/local/sickbeard.config.ini | |
SB_PORT=9400 | |
start() { | |
python2.6 SABnzbd/SABnzbd.py -d -f $SABNZBD_CONFIG | |
python2.6 couchpotato/CouchPotato.py --daemon --pid_file $CP_PID --config_file $CP_CONFIG --data_dir $CP_DATADIR | |
python2.6 sickbeard/SickBeard.py --daemon --pidfile $SB_PID --config $SB_CONFIG --port $SB_PORT | |
} | |
stop() { | |
/opt/bin/wget -q --delete-after "http://$SABNZBD_HOST:$SABNZBD_PORT/sabnzbd/api?mode=shutdown&apikey=$SABNZBD_APIKEY" | |
kill `cat $CP_PID` | |
kill `cat $SB_PID` | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart|reload|condrestart) | |
stop | |
start | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|restart|reload}" | |
exit 1 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment