summaryrefslogtreecommitdiff
path: root/network/sabnzbd/rc.sabnzbd
diff options
context:
space:
mode:
authorPhilip van der Hoeven <philip@vd-hoeven.nl>2014-12-31 19:02:45 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-12-31 19:02:45 +0700
commit9147c65e761cf724e07365776a67d2f1fe429bb5 (patch)
treefb906017b874f512e86c3314907ad5a0de9b2293 /network/sabnzbd/rc.sabnzbd
parentd5784e5912b14ced947426152c08a2fbf2640c1a (diff)
downloadslackbuilds-9147c65e761cf724e07365776a67d2f1fe429bb5.tar.gz
network/sabnzbd: Added (Binary newsreader).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/sabnzbd/rc.sabnzbd')
-rw-r--r--network/sabnzbd/rc.sabnzbd22
1 files changed, 22 insertions, 0 deletions
diff --git a/network/sabnzbd/rc.sabnzbd b/network/sabnzbd/rc.sabnzbd
new file mode 100644
index 0000000000..a2a7c7e69e
--- /dev/null
+++ b/network/sabnzbd/rc.sabnzbd
@@ -0,0 +1,22 @@
+#!/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