changed reference location

This commit is contained in:
Paul Wilde 2023-01-18 21:21:42 +00:00
parent 10893e1d5f
commit 58857451e3

View file

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