Last active
August 29, 2015 14:08
-
-
Save Nokius/fc88ca813b8bf33e5bda to your computer and use it in GitHub Desktop.
init audiobookplayer
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 | |
### BEGIN INIT INFO | |
# Provides: Audiobook-Player | |
# Required-Start: mpd | |
# Required-Stop: | |
# Default-Start: 2 | |
# Default-Stop: 0 1 6 | |
# Description: Startet das python-script fuer Audiobookplayer.py | |
### END INIT INFO | |
PATH=/usr/bin:/usr/lib:/usr/local/bin | |
case "$1" in | |
start) | |
python /home/pi/audiobookplayer.py > /var/log/audiobookplayer 2>&1 & | |
echo "Audiobook laeuft!" | |
;; | |
stop) | |
i=$(pgrep -f audiobookplayer) | |
kill -9 $i | |
echo > /var/log/audiobookplayer | |
echo "Audiobook gestopt!" | |
;; | |
*) | |
echo "Usage: /etc/init.d/audiobookplayer {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