You are not logged in.

#1 2008-07-06 18:36:30

Zepp
Member
From: Ontario, Canada
Registered: 2006-03-25
Posts: 334
Website

[solved] SABnzbd init script

Any sabnzbd users here, who have written a init script for it, by chance?

Last edited by Zepp (2008-07-11 22:11:52)

Offline

#2 2008-07-11 22:07:35

Zepp
Member
From: Ontario, Canada
Registered: 2006-03-25
Posts: 334
Website

Re: [solved] SABnzbd init script

Alright I finished my OS project for school and had some free time so I wrote my own. Maybe someone will find this useful.

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

SABNZBD_USER="sabnzbd"
SABNZBD_CONF="/home/sabnzbd/.sabnzbd/sabnzbd.ini"

PID=`pidof -o %PPID -x SABnzbd.py`
case "$1" in
  start)
    stat_busy "Starting SABnzbd"
    [ -z "$PID" ] && su - $SABNZBD_USER -c "/usr/share/sabnzbd/SABnzbd.py -f $SABNZBD_CONF -d"
    if [ $? -gt 0 ]; then
      stat_fail
    else
      add_daemon sabnzbd
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping SABnzbd"
    [ "$PID" ] && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon sabnzbd
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 2
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0

Offline

#3 2010-03-20 23:07:12

birdie101
Member
Registered: 2010-03-20
Posts: 4

Re: [solved] SABnzbd init script

Sorry to be a complete newb, but how do I get this to run at bootup?

Sorry again

Luke

Offline

#4 2010-03-20 23:42:35

Zepp
Member
From: Ontario, Canada
Registered: 2006-03-25
Posts: 334
Website

Re: [solved] SABnzbd init script

There is a newer version of the unit script in AUR, use that. After you install the aur package or manually save the script to /etc/rc.d/sabnzbd you simply add sabnzbd to the daemons list in /etc/rc.conf like any other daemon.

Offline

Board footer

Powered by FluxBB