#! /bin/sh # sabnzbd+ start/stop SABnzbd+ in sid chroot # ### BEGIN INIT INFO # Provides: sid-sabnzbdplus # 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: SABnzbd+ binary newsgrabber in sid chroot # Description: SABnzbd+ is a web-based binary newsgrabber with nzb # support, designed to download files from Usenet. # This script provides that functionality as a system # service, starting the program on boot. ### END INIT INFO # # Written by Ramon Hofer # SCHROOT=sid NAME=sid-sab start_sab() { schroot -b -n $NAME -c $SCHROOT schroot -r -c $NAME /etc/init.d/sabnzbdplus start } stop_sab() { schroot -rq -c $NAME /etc/init.d/sabnzbdplus stop schroot -eq -c $NAME } case $1 in start) start_sab ;; stop) stop_sab ;; restart | reload | force-reload) stop_sab start_sab ;; *) N=$(basename $0) echo "Usage: /etc/init.d/$N {start|stop|restart|reload|force-reload}" >&2 exit 1 ;; esac exit 0