Rename service variable to hooks
This commit is contained in:
parent
af5be2c1ea
commit
9ff150ff01
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue