Page 1 of 1
SOLVED:Help for writing linux (Antix) shell script to shut down with SABnzbd+
Posted: February 25th, 2009, 3:55 pm
by znab
Hello,
I would be glad to find someone who would like to help me making a "shutdown" script work.
Nice to be helped on the forum, but PM is allright too.
Thanks a lot.
Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+
Posted: February 25th, 2009, 5:17 pm
by jordz
To shutdown sabnzbd you can use something like this:
curl -s http://$SABNZBD_IP:$SABNZBD_PORT/sabnzbd/shutdown &> /dev/null
Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+
Posted: February 26th, 2009, 1:49 pm
by znab
jordz wrote:
To shutdown sabnzbd you can use something like this:
curl -s http://$SABNZBD_IP:$SABNZBD_PORT/sabnzbd/shutdown &> /dev/null
Well, it's my fault I guess. I wanted to shut down my PC after SABnzb+ has finished it's queue.
In a script, called SABshutdown, I have the following:
#!/bin/bash
#
sudo halt
I can execute this script from 'anywhere' because of a path statement and it will shutdown and power off my PC.
But, nothing seems to happen when I put this script in the "On end of queue" of SABnzbd+.
Mayby this will put you on the right path for more help.
Thanks for your reply!
Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+
Posted: February 26th, 2009, 5:06 pm
by shypike
The "sudo" will fail. It wants a password.
You would need to run SABnzbd as root to enable the "halt" command.
This is the reason we don't support the more advanced end-of-queue actions
for Posix systems.
There's not general way to do it and it usually requires elevated privileges.
Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+
Posted: February 27th, 2009, 2:03 pm
by znab
shypike wrote:
The "sudo" will fail. It wants a password.
You would need to run SABnzbd as root to enable the "halt" command.
This is the reason we don't support the more advanced end-of-queue actions
for Posix systems.
There's not general way to do it and it usually requires elevated privileges.
I quite understood you're not supporting it. I was just asking someone who would like to guide me to make it work for me the way I want it to work. By the way I think there are general points to think of to make it work on a linux machine and from your answers and skills I think you know them well. I would be glad to know what they are.
I think there are people out there who made it work and who can and will guide me to make it work for me too. Maybe they will put me on the right track. Thanks to anyone who will.
Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+
Posted: March 2nd, 2009, 12:13 pm
by znab
Got it working now.
Changed the settings of shutdown with chmod u+s /sbin/shutdown
then added a line /sbin/shutdown -h now in the script.