From 9147c65e761cf724e07365776a67d2f1fe429bb5 Mon Sep 17 00:00:00 2001 From: Philip van der Hoeven Date: Wed, 31 Dec 2014 19:02:45 +0700 Subject: network/sabnzbd: Added (Binary newsreader). Signed-off-by: Willy Sudiarto Raharjo --- network/sabnzbd/rc.sabnzbd | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 network/sabnzbd/rc.sabnzbd (limited to 'network/sabnzbd/rc.sabnzbd') 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 -- cgit v1.2.3