Minor changes before merging PR adding Telegram notifications support

This commit is contained in:
zertrin 2017-10-30 23:34:45 +08:00
parent 06291f0a6e
commit a7752c4c78
2 changed files with 2 additions and 2 deletions

View file

@ -419,7 +419,7 @@ MAIL="mailx" # default command for Linux mail
# Third-party notification services. If NOTIFICATION_SERVICE is not provided, no
# notifications will be sent.
# Possible values for NOTIFICATION_SERVICE are: slack, pushover, ifttt
# Possible values for NOTIFICATION_SERVICE are: slack, pushover, ifttt, telegram
NOTIFICATION_SERVICE=""
NOTIFICATION_FAILURE_ONLY="yes" # send notifications only if there was an error while creating backup

View file

@ -559,7 +559,7 @@ send_notification()
https://api.pushover.net/1/messages
echo -e "Pushover notification sent"
elif [ "${NOTIFICATION_SERVICE}" = "telegram" ]; then
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
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
echo -e "Telegram notification sent"
fi
fi