From dd238452c3135b17dbc0065e09c29b9175d48f1a Mon Sep 17 00:00:00 2001 From: napnap75 Date: Sun, 18 Sep 2022 12:46:51 +0200 Subject: [PATCH] Added Gotify notification --- restic-auto/restic-auto | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/restic-auto/restic-auto b/restic-auto/restic-auto index 415be37..d56767f 100755 --- a/restic-auto/restic-auto +++ b/restic-auto/restic-auto @@ -94,7 +94,12 @@ done # Send a notification to Slack if [[ "$SLACK_URL" != "" ]] ; then - curl -s -X POST --data-urlencode "payload={\"username\": \"rpi-docker-backup\", \"icon_emoji\": \":dvd:\", \"text\": \"Backup finished on host $HOSTNAME : $count_success succeeded, $count_failure failed\"}" $SLACK_URL + curl -o /dev/null -s -m 10 --retry 5 -X POST --data-urlencode "payload={\"username\": \"rpi-docker-backup\", \"icon_emoji\": \":dvd:\", \"text\": \"Backup finished on host $HOSTNAME : $count_success succeeded, $count_failure failed\"}" $SLACK_URL +fi + +# Send a notification to Gotify +if [[ "$GOTIFY_URL" != "" ]] ; then + curl -o /dev/null -s -m 10 --retry 5 -X POST -H "accept: application/json" -H "Content-Type: application/json" -d "{\"priority\": 5, \"title\": \"Backup finished on host $HOSTNAME\", \"message\": \"Backup finished on host $HOSTNAME : $count_success succeeded, $count_failure failed\"}" $GOTIFY_URL fi # Return a non zero exit code if an error happened