Updated obackup according to new ofunctions

This commit is contained in:
deajan 2016-11-17 21:01:09 +01:00
parent 169f7b157c
commit 3fe2f1eb88
1 changed files with 9 additions and 10 deletions

View File

@ -9,7 +9,7 @@ PROGRAM="obackup"
AUTHOR="(C) 2013-2016 by Orsiris de Jong" AUTHOR="(C) 2013-2016 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr" CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
PROGRAM_VERSION=2.1-dev PROGRAM_VERSION=2.1-dev
PROGRAM_BUILD=2016111501 PROGRAM_BUILD=2016111701
IS_STABLE=no IS_STABLE=no
source "./ofunctions.sh" source "./ofunctions.sh"
@ -48,22 +48,22 @@ function TrapQuit {
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
RunAfterHook RunAfterHook
fi fi
CleanUp
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
RunAfterHook RunAfterHook
fi fi
CleanUp
Logger "$PROGRAM finished with warnings." "WARN" Logger "$PROGRAM finished with warnings." "WARN"
SendAlert SendAlert
CleanUp
exitcode=2 exitcode=2
else else
RunAfterHook RunAfterHook
CleanUp
Logger "$PROGRAM finshed without errors." "NOTICE" Logger "$PROGRAM finshed without errors." "NOTICE"
CleanUp
exitcode=0 exitcode=0
fi fi
@ -1498,7 +1498,7 @@ function Init {
## Add update to default RSYNC_ARGS ## Add update to default RSYNC_ARGS
RSYNC_ARGS=$RSYNC_ARGS" -u" RSYNC_ARGS=$RSYNC_ARGS" -u"
if [ $_VERBOSE == true ]; then if [ $_LOGGER_VERBOSE == true ]; then
RSYNC_ARGS=$RSYNC_ARGS" -i" RSYNC_ARGS=$RSYNC_ARGS" -i"
fi fi
@ -1596,7 +1596,7 @@ function Usage {
# Command line argument flags # Command line argument flags
_DRYRUN=false _DRYRUN=false
_SILENT=false _LOGGER_SILENT=false
no_maxtime=false no_maxtime=false
stats=false stats=false
PARTIAL=no PARTIAL=no
@ -1615,10 +1615,10 @@ function GetCommandlineArguments {
_DRYRUN=true _DRYRUN=true
;; ;;
--silent) --silent)
_SILENT=true _LOGGER_SILENT=true
;; ;;
--verbose) --verbose)
_VERBOSE=true _LOGGER_VERBOSE=true
;; ;;
--stats) --stats)
stats=false stats=false
@ -1659,8 +1659,7 @@ function GetCommandlineArguments {
GPG_RECIPIENT="${i##*=}" GPG_RECIPIENT="${i##*=}"
;; ;;
--errors-only) --errors-only)
_LOGGER_STDERR=True _LOGGER_ERR_ONLY=true
_LOGGER_ERR_ONLY=True
;; ;;
esac esac
done done