From 1c3b8ca855415082037a35805f934b1eca2d28ee Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Fri, 10 Nov 2023 13:52:52 +0000 Subject: [PATCH] added kuma --- backup.sh | 28 ++++++++++++++++++++++++---- env.sample.sh | 4 ++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/backup.sh b/backup.sh index 94ba945..a1b3f97 100755 --- a/backup.sh +++ b/backup.sh @@ -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 diff --git a/env.sample.sh b/env.sample.sh index 9e66368..0c7c297 100755 --- a/env.sample.sh +++ b/env.sample.sh @@ -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)