From 58857451e30735a38da3cbe872865f16616b82a4 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Wed, 18 Jan 2023 21:21:42 +0000 Subject: [PATCH] changed reference location --- backup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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