mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-26 22:06:35 +01:00
9147c65e76
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
22 lines
492 B
Bash
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
|