user scripts and exit status

Come up with a useful post-processing script? Share it here!
Post Reply
pitch78
Newbie
Newbie
Posts: 4
Joined: October 22nd, 2008, 12:57 am

user scripts and exit status

Post by pitch78 »

Hello,
what happend if a script exit with something else than 0 ?

Because my script return 0 if everything is OK, else it return 1,2,3... depending on problem that occured...

So i would like to have a warning in sabnzbd interface if status is not 0... is it possible ?

thanks in advance !
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: user scripts and exit status

Post by shypike »

Well SABnzbd doesn't do antything with the return code.
There's not much to be done actually, as it is the very last action of post-processing.

There is an existing ticket that asks for the last line of the script output to be shown in History (and email).
This would be more useful.

We could show the script's exit code, but I'm not sure current scripts actually take care
of returning a decent exit code.
pitch78
Newbie
Newbie
Posts: 4
Joined: October 22nd, 2008, 12:57 am

Re: user scripts and exit status

Post by pitch78 »

Ok,
thank you for your answer.
It isn't very important, it was just to try to make something as complete as possible with my scripts...
Camelot
Jr. Member
Jr. Member
Posts: 64
Joined: August 18th, 2008, 6:23 am

Re: user scripts and exit status

Post by Camelot »

I read somewhere that the post processing scripts should return an exit code, so I put a lot of work into returning a unique integer depending on what error occurred, only to find out that nothing is done with this integer. I would like sabnzbd to show an error if anything else then 0 is returned, perhaps as an intermediate step it could display all ok if 0 or nothing is received, while an error is shown if anything else is returned :)
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: user scripts and exit status

Post by shypike »

I'll file a ticket for it.
Post Reply