Page 1 of 1

user scripts and exit status

Posted: November 4th, 2008, 4:19 am
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 !

Re: user scripts and exit status

Posted: November 4th, 2008, 2:04 pm
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.

Re: user scripts and exit status

Posted: November 5th, 2008, 2:56 am
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...

Re: user scripts and exit status

Posted: November 5th, 2008, 4:22 am
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 :)

Re: user scripts and exit status

Posted: November 5th, 2008, 6:05 am
by shypike
I'll file a ticket for it.