Rename service variable to hooks

This commit is contained in:
JuliusFreudenberger 2022-02-20 19:07:06 +01:00
parent af5be2c1ea
commit 9ff150ff01

View file

@ -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
}