a7752c4c78b98c0223542ba3a370c735bf269807

Author
zertrin <zertrin@gmail.com>
Committer
zertrin <zertrin@gmail.com>
Date

Message

Minor changes before merging PR adding Telegram notifications support

Diff

 1diff --git a/duplicity-backup.conf.example b/duplicity-backup.conf.example
 2index 0391982c7aafed1b97af830ed5016f71b20192e0..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 
14diff --git a/duplicity-backup.sh b/duplicity-backup.sh
15index 8b2f0f109fbc2576f9d5c2fb834400dbee48672d..8642d596f268172bbaa9a6d4a7844cd1f5769044 100755
16--- a/duplicity-backup.sh
17+++ b/duplicity-backup.sh
18@@ -559,7 +559,7 @@ send_notification()
19       https://api.pushover.net/1/messages
20       echo -e "Pushover notification sent"
21     elif [ "${NOTIFICATION_SERVICE}" = "telegram" ]; then
22-        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
23+        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
24       echo -e "Telegram notification sent"
25     fi
26   fi