Exit-Codes for opsi-admin

Since opsi-utils 4.0.6.3 opsi-admin will fail with appropriate exit codes when used non-interactive to make writing scripts and reacting to failure easier.

The old behaviour was that every call in non-interactive mode - usually by supplying -d - returned an exit-code of 0. This made it very hard to check if something went wrong during such a call.

The new opsi-admin will return an appropriate exit-code when things fail:

  • Exit code 1 will be returned whenever the call itself is problematic - unknown method or wrong/missing parameters.
  • Exit code 2 will be returned when the call to the API was correct but the executed method did return an error.

If you rely on the old behaviour where everything returned exit code 0 you now need to supply --exit-zero to your call of opsi-admin.