How to send pause command via a bash 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
habskilla
Newbie
Newbie
Posts: 12
Joined: June 22nd, 2008, 11:49 am

How to send pause command via a bash script?

Post by habskilla »

Not a sabnzbd question but a linux question.

If i enter this, http://my url/sabnzbd/api?mode=pause, into a browser it will pause sabnzbd. 

The question I have is how can I do the pause command from a bash script?

I've tried wget -q http://my url/sabnzbd/api?mode=pause but that just creates a file called "api?mode=pause"
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: How to send pause command via a bash script?

Post by shypike »

How about:

Code: Select all

wget -q --delete-after "http://host:port/sabnzbd/api?mode=pause"
Without the quotes, bash will think that the '?' is a wild-card.
habskilla
Newbie
Newbie
Posts: 12
Joined: June 22nd, 2008, 11:49 am

Re: How to send pause command via a bash script?

Post by habskilla »

doesn't work  :-\
rAf
Moderator
Moderator
Posts: 546
Joined: April 28th, 2008, 2:35 pm
Location: France
Contact:

Re: How to send pause command via a bash script?

Post by rAf »

try this :

Code: Select all

curl "http://host:port/sabnzbd/api?mode=pause"
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: How to send pause command via a bash script?

Post by shypike »

habskilla wrote: doesn't work  :-\
I'm sorry, but the wget works fine on my Ubuntu-8.04 server box.
(and curl too).
Last edited by shypike on July 1st, 2008, 3:44 pm, edited 1 time in total.
habskilla
Newbie
Newbie
Posts: 12
Joined: June 22nd, 2008, 11:49 am

Re: How to send pause command via a bash script?

Post by habskilla »

Found the solution.  The reason it wasn't working was because of lack of authorization.  From the wiki advanced options I found the solution.

Code: Select all

wget -q --delete-after "http://localhost:8080/sabnzbd/api?mode=resume&ma_username=user&ma_password=password"
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: How to send pause command via a bash script?

Post by shypike »

OK, I had not thought of the username/pw either, since it's optional.
Post Reply