7 PID
="$(pgrep -f -u "${SABNZBD_USER}" SABnzbd.py)"
11 stat_busy
"Starting SABnzbd"
13 if [ -f /run
/daemons
/sabnzbd
]; then
14 echo -n "Sabnzbd is already running as a daemon! If you are certain it is not running, remove /run/daemons/sabnzbd."
17 su
- "${SABNZBD_USER}" -c "python2 ${SABNZBD_DIR}/SABnzbd.py ${SABNZBD_ARGS}" -s /bin
/sh
18 if [ "${?}" -gt 0 ]; then
28 stat_busy
"Stopping SABnzbd"
30 curl
-f "${SABNZBD_PROTOCOL}://${SABNZBD_USPW}${SABNZBD_IP}:${SABNZBD_PORT}/sabnzbd/api?mode=shutdown&apikey=${SABNZBD_KEY}" &> /dev
/null
32 if [ "${?}" -gt 0 ]; then
41 stat_busy
"Stopping SABnzbd (forced)"
43 [ -n "${PID}" ]; kill "${PID}" &> /dev
/null
45 if [ "${?}" -gt 0 ]; then
49 [ -f /run
/daemons
/sabnzbd
]; rm -f /run
/daemons
/sabnzbd
&> /dev
/null
65 stat_busy
"Checking SABnzbd status";
69 echo "usage: ${0} {start|stop|restart|force-stop|force-restart|status}"