Diff
1diff --git a/duplicity-backup.conf.example b/duplicity-backup.conf.example
2index 0a0dc992fd29f4e8fb627d672c7cc5fba0de0c0b..50b1b6af63ea758e3fcf1a47a819635cca5d8381 100644
3--- a/duplicity-backup.conf.example
4+++ b/duplicity-backup.conf.example
5@@ -419,7 +419,7 @@ MAIL="mailx" # default command for Linux mail
6 # Third-party notification services. If NOTIFICATION_SERVICE is not provided, no
7 # notifications will be sent.
8
9-# Possible values for NOTIFICATION_SERVICE are: slack, pushover, ifttt
10+# Possible values for NOTIFICATION_SERVICE are: slack, pushover, ifttt, telegram
11 NOTIFICATION_SERVICE=""
12 NOTIFICATION_FAILURE_ONLY="yes" # send notifications only if there was an error while creating backup
13
14@@ -439,6 +439,10 @@ IFTTT_MAKER_EVENT="duplicity" # name the event to trigger at IFTTT Maker Channel
15 IFTTT_HOOK_URL="https://maker.ifttt.com/trigger/$IFTTT_MAKER_EVENT/with/key/$IFTTT_KEY" # ONLY change this if IFTTT changes it
16 IFTTT_VALUE2="" # general purpose value to pass to your maker channel (optional)
17
18+# Provider: Telegram
19+TELEGRAM_CHATID="" #Generate a Telegram bot following guide: https://core.telegram.org/bots#3-how-do-i-create-a-bot
20+TELEGRAM_KEY=""
21+
22 # ------------------------------------------------------------------------------
23 # TROUBLESHOOTING
24 # ------------------------------------------------------------------------------
25diff --git a/duplicity-backup.sh b/duplicity-backup.sh
26index a99ab06c4fa2d807983ff85eb52dba59bccee9c4..8642d596f268172bbaa9a6d4a7844cd1f5769044 100755
27--- a/duplicity-backup.sh
28+++ b/duplicity-backup.sh
29@@ -558,6 +558,9 @@ send_notification()
30 -F "message=${NOTIFICATION_CONTENT}" \
31 https://api.pushover.net/1/messages
32 echo -e "Pushover notification sent"
33+ elif [ "${NOTIFICATION_SERVICE}" = "telegram" ]; then
34+ curl -s --max-time 10 -d "chat_id=${TELEGRAM_CHATID}&disable_web_page_preview=1&text=${NOTIFICATION_CONTENT}" "https://api.telegram.org/bot${TELEGRAM_KEY}/sendMessage" >/dev/null
35+ echo -e "Telegram notification sent"
36 fi
37 fi
38 }