b92d60f028dffb94dc3aff2cd674dce4d5a9f48c
- Author
- zertrin <zertrin@gmail.com>
- Committer
- zertrin <zertrin@gmail.com>
- Date
Message
Merge commit '0501d233' into dev
Diff
1diff --git a/duplicity-backup.conf.example b/duplicity-backup.conf.example
2index 5ac28fdda698ea69889e56a03e53cb4e12cf1f31..217381fed3a48f764317f6a18e9618cbdf1c3237 100644
3--- a/duplicity-backup.conf.example
4+++ b/duplicity-backup.conf.example
5@@ -418,6 +418,10 @@ SLACK_CHANNEL="#general"
6 SLACK_USERNAME="duplicity-backup"
7 SLACK_EMOJI="package"
8
9+# Provider: Pushover
10+PUSHOVER_TOKEN="" # App token generated at pushover.net
11+PUSHOVER_USER="" # User key from pushover.net
12+
13
14 # ------------------------------------------------------------------------------
15 # TROUBLESHOOTING
16diff --git a/duplicity-backup.sh b/duplicity-backup.sh
17index 4819a7d31bb019e46c88c3ad3c67ad215b8bf8ff..5e122b2718b7ae32de518d756ceee442339945b2 100755
18--- a/duplicity-backup.sh
19+++ b/duplicity-backup.sh
20@@ -410,8 +410,14 @@ send_notification()
21 if [ ! -z "${NOTIFICATION_SERVICE}" ]; then
22 if [ "${NOTIFICATION_SERVICE}" = "slack" ]; then
23 curl -X POST -H 'Content-type: application/json' --data "{\"text\": \"${NOTIFICATION_CONTENT}\", \"channel\": \"${SLACK_CHANNEL}\", \"username\": \"${SLACK_USERNAME}\", \"icon_emoji\": \":${SLACK_EMOJI}:\"}" "${SLACK_HOOK_URL}"
24-
25 echo -e "Slack notification sent to channel ${SLACK_CHANNEL}" >> "${LOGFILE}"
26+ elif [ "${NOTIFICATION_SERVICE}" = "pushover" ]; then
27+ curl -s \
28+ -F "token=${PUSHOVER_TOKEN}" \
29+ -F "user=${PUSHOVER_USER}" \
30+ -F "message=${NOTIFICATION_CONTENT}" \
31+ https://api.pushover.net/1/messages
32+ echo -e "Pushover notification sent" >> "${LOGFILE}"
33 fi
34 fi
35 }