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)