diff --git a/backup_script.sh b/backup_script.sh index 3cc1748..5a97211 100755 --- a/backup_script.sh +++ b/backup_script.sh @@ -8,7 +8,7 @@ PING_ROUTE=$HC_HOST/ping/$HC_UUID HAS_HOOKS="" checkInput() { - for variable in SERVICE BACKUP_PATH HC_UUID RESTIC_REPOSITORY RESTIC_PASSWORD; do + for variable in HOOKS BACKUP_PATH HC_UUID RESTIC_REPOSITORY RESTIC_PASSWORD; do if [[ -z ${!variable} ]]; then echo "Variable $variable not given" exit 1 @@ -17,13 +17,13 @@ checkInput() { } checkForHooks() { - test -f "$SERVICE.sh" && HAS_HOOKS=1 + test -f "$HOOKS.sh" && HAS_HOOKS=1 } loadServiceHooks() { if [ "$HAS_HOOKS" == "1" ]; then - echo "Loading hooks for service $SERVICE" - source "$SERVICE.sh" + echo "Loading hooks $HOOKS" + source "$HOOKS.sh" fi }