diff --git a/backup_script.sh b/backup_script.sh index 5a97211..2a7f28d 100755 --- a/backup_script.sh +++ b/backup_script.sh @@ -16,6 +16,10 @@ checkInput() { done } +goIntoScriptDirectory() { + cd $(dirname "${BASH_SOURCE[0]}") +} + checkForHooks() { test -f "$HOOKS.sh" && HAS_HOOKS=1 } @@ -71,6 +75,7 @@ exitPrematurely() { # Backup the service and call healthchecks backup() { checkInput + goIntoScriptDirectory healthStart checkForHooks