Simplified cleanup functions

This commit is contained in:
deajan 2016-11-17 21:05:07 +01:00
parent 16fc043322
commit 6c9e4082be
1 changed files with 1 additions and 3 deletions

View File

@ -50,7 +50,6 @@ function TrapQuit {
fi fi
Logger "$PROGRAM finished with errors." "ERROR" Logger "$PROGRAM finished with errors." "ERROR"
SendAlert SendAlert
CleanUp
exitcode=1 exitcode=1
elif [ $WARN_ALERT == true ]; then elif [ $WARN_ALERT == true ]; then
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
@ -58,12 +57,10 @@ function TrapQuit {
fi fi
Logger "$PROGRAM finished with warnings." "WARN" Logger "$PROGRAM finished with warnings." "WARN"
SendAlert SendAlert
CleanUp
exitcode=2 exitcode=2
else else
RunAfterHook RunAfterHook
Logger "$PROGRAM finshed without errors." "NOTICE" Logger "$PROGRAM finshed without errors." "NOTICE"
CleanUp
exitcode=0 exitcode=0
fi fi
@ -71,6 +68,7 @@ function TrapQuit {
rm -f "$RUN_DIR/$PROGRAM.$INSTANCE_ID" rm -f "$RUN_DIR/$PROGRAM.$INSTANCE_ID"
fi fi
CleanUp
KillChilds $$ > /dev/null 2>&1 KillChilds $$ > /dev/null 2>&1
exit $exitcode exit $exitcode
} }