#!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ opts="start stop" depend() { need net } start() { ebegin "Starting SABnzbd" if ! check_config ; then eend 1 return 1 fi start-stop-daemon --quiet --start -c ${SAB_USER}:${SAB_GROUP} \ --exec /usr/bin/SABnzbd.py -- \ -f ${SAB_CONFIGFILE} -d &> /dev/null eend $? } stop() { ebegin "Stopping SABnzbd" start-stop-daemon --quiet --stop \ --name SABnzbd.py eend $? } check_config() { if [ ! -e ${SAB_CONFIGFILE} ] ; then eerror "ERROR: can't find ${SAB_CONFIGFILE}." return 1 else return 0 fi }