Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### BEGIN INIT INFO
- # Provides: headphones
- # Required-Start: $local_fs $network $remote_fs
- # Required-Stop: $local_fs $network $remote_fs
- # Should-Start: $NetworkManager
- # Should-Stop: $NetworkManager
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: starts and stops headphones
- # Description: Automatic music downloader for SABnzbd. For more information see:
- # http://http://headphones.codeshy.com/forum/
- ### END INIT INFO
- #Required — Must Be Changed!
- USER=”xxxxxxx” #Set Linux Mint, Ubuntu, or Debian user name here.
- #Required — Defaults Provided (only change if you know you need to).
- HOST=”XXX.XXX.X.XX” #Set headphones address here.
- PORT=”XXXX” #Set headphones port here.
- #Optional — Unneeded unless you have added a user name and password to Headphones.
- SBUSR=”XXXXXX” #Set Headphones user name (if you use one) here.
- SBPWD=”XXXXXX” #Set Headphones password (if you use one) here.
- #Script — No changes needed below.
- case “$1” in
- start)
- #Start Headphones and send all messages to /dev/null.
- cd /usr/local/headphones
- echo “Starting Headphones”
- sudo su headphones -c “/usr/local/headphones/Headphones.py —datadir=/var/headphones —config=/var/headphones/headphones.ini” > /dev/null 2>&1 &
- ;;
- stop)
- #Shutdown Headphones and delete the index.html files that wget generates.
- echo “Stopping Headphones”
- wget -q —user=$SBUSR —password=$SBPWD “http://$HOST:$PORT/shutdown/” —delete-after
- sleep 6s
- ;;
- *)
- echo “Usage: $0 {start|stop}”
- exit 1
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement