From 9ff150ff01d22ddb07dc9398d6d08909597b56f0 Mon Sep 17 00:00:00 2001 From: JuliusFreudenberger Date: Sun, 20 Feb 2022 19:07:06 +0100 Subject: [PATCH] Rename service variable to hooks --- backup_script.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }