added kuma

This commit is contained in:
Paul Wilde 2023-11-10 13:52:52 +00:00
parent 876288be46
commit 1c3b8ca855
2 changed files with 28 additions and 4 deletions

View file

@ -13,11 +13,21 @@ fi
running=$(pgrep -f "$BACKUP_CMD")
if [[ $running ]]; then
echo "Backup alreadying running : $running. Exiting..."
curl https://hc-ping.com/$HEALTHCHECK_UUID/fail
if [[ $HEALTHCHECK_UUID != "" ]]; then
curl "https://hc-ping.com/$HEALTHCHECK_UUID/fail"
fi
if [[ $KUMA_ID != "" ]]; then
curl "https://$KUMA_URL/api/push/$KUMA_ID?status=down&msg=Failed&ping="
fi
exit
fi
echo "Not currently running. Continuing..."
curl https://hc-ping.com/$HEALTHCHECK_UUID/start
if [[ $HEALTHCHECK_UUID != "" ]]; then
curl "https://hc-ping.com/$HEALTHCHECK_UUID/start"
fi
if [[ $KUMA_ID != "" ]]; then
curl "https://$KUMA_URL/api/push/$KUMA_ID?status=up&msg=Running&ping="
fi
if [[ $PRE_RUN_SCRIPT ]]; then
$dir/$PRE_RUN_SCRIPT
fi
@ -26,7 +36,17 @@ if [[ $? == 0 ]]; then
if [[ $POST_RUN_SCRIPT ]]; then
$dir/$POST_RUN_SCRIPT
fi
curl https://hc-ping.com/$HEALTHCHECK_UUID
if [[ $HEALTHCHECK_UUID != "" ]]; then
curl "https://hc-ping.com/$HEALTHCHECK_UUID"
fi
if [[ $KUMA_ID != "" ]]; then
curl "https://$KUMA_URL/api/push/$KUMA_ID?status=up&msg=Completed&ping="
fi
else
curl https://hc-ping.com/$HEALTHCHECK_UUID/fail
if [[ $HEALTHCHECK_UUID != "" ]]; then
curl "https://hc-ping.com/$HEALTHCHECK_UUID/fail"
fi
if [[ $KUMA_ID != "" ]]; then
curl "https://$KUMA_URL/api/push/$KUMA_ID?status=down&msg=Failed&ping="
fi
fi

View file

@ -8,6 +8,10 @@ BACKUP_PARAMS=""
BACKUP_EXCLUDE_FILE=""
# https://healthchecks.io uuid
HEALTHCHECK_UUID=""
# Uptime Kuma URL
KUMA_URL=""
# Uptime Kuma Push ID
KUMA_ID=""
# name of a script to run before (ideally in the "pre/" dir)
PRE_RUN_SCRIPT=""
# name of a script to run after (ideally in the "post/" dir)