How to provide specific exitcode from a gradle script?


(Christian Finckler) #1

Hello, I want to write a script with gradle which returns specific exitcodes. The gradle script should be called from icinga which expects certain exitcodes like: 0 if everything is ok 1 if the link speed is above the expected 2 if no link detected or the link speed is below the expected 3 if the number of arguments is incorrect

But I could not find out how to return a specific exitcode from within a gradle script.

Thank you very much, chris


(Luke Daley) #2

There’s no safe way to do this at the moment. You’d have to wrap your Gradle invocation in another script that interpreted the results and returned the code you want.