Add going to script dir to allow execution from any folder

This commit is contained in:
JuliusFreudenberger 2022-02-20 19:14:19 +01:00
parent 9ff150ff01
commit 751b37c2c8

View file

@ -16,6 +16,10 @@ checkInput() {
done done
} }
goIntoScriptDirectory() {
cd $(dirname "${BASH_SOURCE[0]}")
}
checkForHooks() { checkForHooks() {
test -f "$HOOKS.sh" && HAS_HOOKS=1 test -f "$HOOKS.sh" && HAS_HOOKS=1
} }
@ -71,6 +75,7 @@ exitPrematurely() {
# Backup the service and call healthchecks # Backup the service and call healthchecks
backup() { backup() {
checkInput checkInput
goIntoScriptDirectory
healthStart healthStart
checkForHooks checkForHooks