From 6c9e4082beb01698cabed33828ba6ca64336c6d3 Mon Sep 17 00:00:00 2001 From: deajan Date: Thu, 17 Nov 2016 21:05:07 +0100 Subject: [PATCH] Simplified cleanup functions --- dev/n_obackup.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dev/n_obackup.sh b/dev/n_obackup.sh index 962cb3d..e699715 100755 --- a/dev/n_obackup.sh +++ b/dev/n_obackup.sh @@ -50,7 +50,6 @@ function TrapQuit { fi Logger "$PROGRAM finished with errors." "ERROR" SendAlert - CleanUp exitcode=1 elif [ $WARN_ALERT == true ]; then if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then @@ -58,12 +57,10 @@ function TrapQuit { fi Logger "$PROGRAM finished with warnings." "WARN" SendAlert - CleanUp exitcode=2 else RunAfterHook Logger "$PROGRAM finshed without errors." "NOTICE" - CleanUp exitcode=0 fi @@ -71,6 +68,7 @@ function TrapQuit { rm -f "$RUN_DIR/$PROGRAM.$INSTANCE_ID" fi + CleanUp KillChilds $$ > /dev/null 2>&1 exit $exitcode }