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
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