FreeNAS shutdown script
Posted: October 12th, 2011, 5:02 pm
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.
I have also tried :
Any help is welocme.
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
Code: Select all
/usr/bin/fetch http://$HOST:$PORT/sabnzbd/shutdown?session=$MYAPI