mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-22 19:44:21 +01:00
23 lines
492 B
Text
23 lines
492 B
Text
|
#!/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
|