Merge commit '0501d233' into dev

This commit is contained in:
zertrin 2016-04-29 14:34:39 +02:00
commit b92d60f028
2 changed files with 11 additions and 1 deletions

View file

@ -418,6 +418,10 @@ SLACK_CHANNEL="#general"
SLACK_USERNAME="duplicity-backup"
SLACK_EMOJI="package"
# Provider: Pushover
PUSHOVER_TOKEN="" # App token generated at pushover.net
PUSHOVER_USER="" # User key from pushover.net
# ------------------------------------------------------------------------------
# TROUBLESHOOTING

View file

@ -410,8 +410,14 @@ send_notification()
if [ ! -z "${NOTIFICATION_SERVICE}" ]; then
if [ "${NOTIFICATION_SERVICE}" = "slack" ]; then
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}"
echo -e "Slack notification sent to channel ${SLACK_CHANNEL}" >> "${LOGFILE}"
elif [ "${NOTIFICATION_SERVICE}" = "pushover" ]; then
curl -s \
-F "token=${PUSHOVER_TOKEN}" \
-F "user=${PUSHOVER_USER}" \
-F "message=${NOTIFICATION_CONTENT}" \
https://api.pushover.net/1/messages
echo -e "Pushover notification sent" >> "${LOGFILE}"
fi
fi
}