slackbuilds_ponce/network/sabnzbd/rc.sabnzbd
Philip van der Hoeven 9147c65e76 network/sabnzbd: Added (Binary newsreader).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2014-12-31 19:02:45 +07:00

22 lines
492 B
Bash

#!/bin/bash
SABNZBD_USER="sabnzbd"
SABNZBD_CONF="/etc/sabnzbd/sabnzbd.ini"
PIDFILE="/var/run/sabnzbd/sabnzbd-8080.pid"
case "$1" in
start)
if [[ -f $PIDFILE ]]; then
echo "Pidfile $PIDFILE already exists, is sabnzbd already running ?"
exit 1
fi
su - $SABNZBD_USER -c "unset DISPLAY; python -OO /opt/sabnzbd/SABnzbd.py -f $SABNZBD_CONF -d --pid /var/run/sabnzbd" -s /bin/sh
;;
stop)
kill $(cat $PIDFILE)
;;
*)
echo "usage: $0 {start|stop}"
esac
exit 0