When we call an hook we should not exit with the error code. Instead we should return the code to the function that called that hook function. So we candle handle errors better.
Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/functions/functions.hook | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/functions/functions.hook b/src/functions/functions.hook index b99023d..d1f6506 100644 --- a/src/functions/functions.hook +++ b/src/functions/functions.hook @@ -102,11 +102,11 @@ hook_exec() { ${EXIT_COMMAND_NOT_FOUND}|${EXIT_NOT_SUPPORTED}) log ERROR "Hook '${hook}' does not implement the method '${cmd}':" log ERROR " arguments: $@" - exit ${EXIT_COMMAND_NOT_FOUND} + return ${EXIT_COMMAND_NOT_FOUND} ;; ${EXIT_ERROR_ASSERT}) log ERROR "Hook exited with an assertion error." - exit ${EXIT_ERROR_ASSERT} + return ${EXIT_ERROR_ASSERT} ;; esac