Created
March 25, 2012 19:06
-
-
Save crsantos/2199084 to your computer and use it in GitHub Desktop.
init.d daemon for Plex-Trakt scrobbler
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/bash | |
USER="CHANGE_NAME" | |
NAME=traktscrobbler | |
PIDFILE=/var/run/$NAME.pid | |
DAEMON=/usr/bin/python | |
SCRIPT=/CHANGE/PATH/TO/Plex-Trakt-Scrobbler/script.py | |
case "$1" in | |
start) | |
echo "Starting $NAME" | |
start-stop-daemon --start --quiet --user $USER --background --pidfile $PIDFILE --make-pidfile --exec $DAEMON $SCRIPT > /dev/null | |
echo "$NAME started!" | |
;; | |
stop) | |
echo "Stopping $NAME" | |
/sbin/start-stop-daemon --stop --pidfile $PIDFILE --verbose | |
;; | |
*) | |
echo "Usage: /etc/init.d/$NAME {start|stop}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment