diff --git a/backup.sh b/backup.sh index 17801d3..626c87d 100755 --- a/backup.sh +++ b/backup.sh @@ -1,5 +1,6 @@ #!/bin/bash -source env.sh +dir=$(dirname "${BASH_SOURCE[0]}") +source $dir/env.sh DATE=$(date +"%Y-%m-%d %H:%M:%S") echo "Backup $NAME at $DATE" BACKUP_CMD="restic backup $BACKUP_DIR" @@ -18,12 +19,12 @@ fi echo "Not currently running. Continuing..." curl https://hc-ping.com/$HEALTHCHECK_UUID/start if [[ $PRE_RUN_SCRIPT ]]; then - $(pwd)/$PRE_RUN_SCRIPT + $dir/$PRE_RUN_SCRIPT fi $BACKUP_CMD if [[ $? == 0 ]]; then if [[ $POST_RUN_SCRIPT ]]; then - $(pwd)/$POST_RUN_SCRIPT + $dir/$POST_RUN_SCRIPT fi curl https://hc-ping.com/$HEALTHCHECK_UUID else