mirror of
https://github.com/deajan/obackup.git
synced 2025-01-12 23:23:53 +01:00
Simplified cleanup functions
This commit is contained in:
parent
16fc043322
commit
6c9e4082be
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user