SABnzbd

Wiki

User Manual FAQ Contact Introduction Installation Configuration Scripts Advanced Topics Extensions for SABnzbd

Incorrect or missing information? Install As A Unix Daemon

Running SABnzbd directly from a shell or a desktop shortcut is not always practical, especially not on a server.
It is important that SABnzbd is closed properly when a system goes down, otherwise data will be lost.

Below is an example start/stop script that can also be called from init.d scripts.
You need to replace sabuser with the proper user account and HOSTADDRESS:PORT by the proper address and port.
This assumes that you have installed SABnzbd in folder /usr/local/src/SABnzbd.

#!/bin/sh

case "$1" in
start)
  echo "Starting SABnzbd."
  /usr/bin/sudo -u sabuser -H /usr/local/src/SABnzbd/SABnzbd.py -d -f /home/sabuser/.sabnzbd/sabnzbd.ini
;;
stop)
  echo "Shutting down SABnzbd."
  /usr/bin/wget -q --delete-after "http://HOSTADDRESS:PORT/sabnzbd/api?mode=shutdown&apikey=ENTERAPIKEYHERE"
;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
esac

exit 0

If you use a password to secure SABnzbd, modify the shutdown url to the following:

http://HOSTADDRESS:PORT/sabnzbd/api?mode=shutdown&ma_username=USER&ma_password=PASSWORD&apikey=ENTERAPIKEYHER

Note: This may not be applicable for your distribution! Debian and Ubuntu have their own init script, see the Ubuntu Install Docs.