Advertisement
Guest User

Untitled

a guest
Jul 11th, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.53 KB | None | 0 0
  1. ### BEGIN INIT INFO
  2. # Provides: headphones
  3. # Required-Start: $local_fs $network $remote_fs
  4. # Required-Stop: $local_fs $network $remote_fs
  5. # Should-Start: $NetworkManager
  6. # Should-Stop: $NetworkManager
  7. # Default-Start: 2 3 4 5
  8. # Default-Stop: 0 1 6
  9. # Short-Description: starts and stops headphones
  10. # Description: Automatic music downloader for SABnzbd. For more information see:
  11. # http://http://headphones.codeshy.com/forum/
  12. ### END INIT INFO
  13. #Required — Must Be Changed!
  14. USER=”xxxxxxx” #Set Linux Mint, Ubuntu, or Debian user name here.
  15. #Required — Defaults Provided (only change if you know you need to).
  16. HOST=”XXX.XXX.X.XX#Set headphones address here.
  17. PORT=”XXXX” #Set headphones port here.
  18. #Optional — Unneeded unless you have added a user name and password to Headphones.
  19. SBUSR=”XXXXXX” #Set Headphones user name (if you use one) here.
  20. SBPWD=”XXXXXX” #Set Headphones password (if you use one) here.
  21. #Script — No changes needed below.
  22. case “$1in
  23. start)
  24. #Start Headphones and send all messages to /dev/null.
  25. cd /usr/local/headphones
  26. echo “Starting Headphones”
  27. sudo su headphones -c “/usr/local/headphones/Headphones.py —datadir=/var/headphones —config=/var/headphones/headphones.ini> /dev/null 2>&1 &
  28. ;;
  29. stop)
  30. #Shutdown Headphones and delete the index.html files that wget generates.
  31. echo “Stopping Headphones”
  32. wget -q —user=$SBUSR —password=$SBPWD “http://$HOST:$PORT/shutdown/” —delete-after
  33. sleep 6s
  34. ;;
  35. *)
  36. echo “Usage: $0 {start|stop}
  37. exit 1
  38. esac
  39. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement