SOLVED:Help for writing linux (Antix) shell script to shut down with SABnzbd+

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
znab
Newbie
Newbie
Posts: 8
Joined: February 23rd, 2009, 1:28 pm

SOLVED:Help for writing linux (Antix) shell script to shut down with SABnzbd+

Post 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.
Last edited by znab on March 2nd, 2009, 12:14 pm, edited 1 time in total.
greetz,

znab

SAnzbd+ 0.4.6 on Antix M8.5
jordz
Newbie
Newbie
Posts: 19
Joined: December 21st, 2008, 10:49 am

Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+

Post by jordz »

To shutdown sabnzbd you can use something like this:
curl -s http://$SABNZBD_IP:$SABNZBD_PORT/sabnzbd/shutdown &> /dev/null
Arch Linux sabnbzd-svn package: http://aur.archlinux.org/packages.php?ID=21941
znab
Newbie
Newbie
Posts: 8
Joined: February 23rd, 2009, 1:28 pm

Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+

Post 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!
greetz,

znab

SAnzbd+ 0.4.6 on Antix M8.5
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+

Post 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.
znab
Newbie
Newbie
Posts: 8
Joined: February 23rd, 2009, 1:28 pm

Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+

Post 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.
greetz,

znab

SAnzbd+ 0.4.6 on Antix M8.5
znab
Newbie
Newbie
Posts: 8
Joined: February 23rd, 2009, 1:28 pm

Re: Help for writing linux (Antix) shell script to shut down with SABnzbd+

Post 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.
greetz,

znab

SAnzbd+ 0.4.6 on Antix M8.5
Post Reply