FreeNAS shutdown script

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Placemaster
Newbie
Newbie
Posts: 19
Joined: July 1st, 2010, 2:10 pm

FreeNAS shutdown script

Post by Placemaster »

I am trying to autostart and shutdown SABnzbd+ in FreeNAS.

The autostart function is working without problems. But the shutdown function reports constantly that the API key is not correct.
I have checked it 10 times and it is correct. Please find below the code I have used.

Code: Select all

#! /bin/bash

    ## CONFIG ##
    HOST="192.168.1.99"
    PORT="7777"
    MYAPI="b7f2fc75ed4a2b265ce3bac741e4680c"
    ## / CONFIG ##

    case "$1" in
    start)
    echo "Starting SABnzbd."

    /mnt/FreeNAS/Temp/SABnzbd-0.6.9/SABnzbd.py -d -f /mnt/FreeNAS/Temp/SABconfig/sabnzbd.ini
    ;;
    stop)
    echo "Shutting down SABnzbd."

    /usr/bin/fetch "http://192.168.1.99:7777/sabnzbd/shutdown?session=b7f2fc75ed4a2b265ce3bac741e4680c" >> /dev/null
    ;;
    *)
    echo "Usage: $0 {start|stop}"
    exit 1
    esac

    exit 0
I have also tried :

Code: Select all

/usr/bin/fetch http://$HOST:$PORT/sabnzbd/shutdown?session=$MYAPI
Any help is welocme.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: FreeNAS shutdown script

Post by shypike »

Don't use session, but apikey.
Also, I'm not sure about the quotes you are using here:
MYAPI="blabla"
Placemaster
Newbie
Newbie
Posts: 19
Joined: July 1st, 2010, 2:10 pm

Re: FreeNAS shutdown script

Post by Placemaster »

I tried your comments but it will not work.
Tomorrow I will continue with it as it is already 0:45.
Post Reply