Advertisement
Powderking

sid-sabnzbdplus init.d schroot

Jul 21st, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. #! /bin/sh
  2. # sabnzbd+ start/stop SABnzbd+ in sid chroot
  3. #
  4. ### BEGIN INIT INFO
  5. # Provides: sid-sabnzbdplus
  6. # Required-Start: $local_fs $network $remote_fs
  7. # Required-Stop: $local_fs $network $remote_fs
  8. # Should-Start: NetworkManager
  9. # Should-Stop: NetworkManager
  10. # Default-Start: 2 3 4 5
  11. # Default-Stop: 0 1 6
  12. # Short-Description: SABnzbd+ binary newsgrabber in sid chroot
  13. # Description: SABnzbd+ is a web-based binary newsgrabber with nzb
  14. # support, designed to download files from Usenet.
  15. # This script provides that functionality as a system
  16. # service, starting the program on boot.
  17. ### END INIT INFO
  18. #
  19. # Written by Ramon Hofer <ramonhofer@bluewin.ch>
  20. #
  21.  
  22. SCHROOT=sid
  23. NAME=sid-sab
  24.  
  25.  
  26. start_sab() {
  27. schroot -b -n $NAME -c $SCHROOT
  28. schroot -r -c $NAME /etc/init.d/sabnzbdplus start
  29. }
  30.  
  31. stop_sab() {
  32. schroot -rq -c $NAME /etc/init.d/sabnzbdplus stop
  33. schroot -eq -c $NAME
  34. }
  35.  
  36.  
  37. case $1 in
  38. start)
  39. start_sab
  40. ;;
  41. stop)
  42. stop_sab
  43. ;;
  44. restart | reload | force-reload)
  45. stop_sab
  46. start_sab
  47. ;;
  48. *)
  49. N=$(basename $0)
  50. echo "Usage: /etc/init.d/$N {start|stop|restart|reload|force-reload}" >&2
  51. exit 1
  52. ;;
  53. esac
  54.  
  55. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement