add pushover support

This commit is contained in:
Benjamin Bryan
2017-03-12 22:06:33 -07:00
parent f2f4413e28
commit f7d96c204f
2 changed files with 15 additions and 0 deletions

View File

@@ -153,6 +153,11 @@ PB_KEY=""
# IFTTT Event Name
IFTTT_EVENT="arm_event"
# Pushover API User and Application Key
# Leave User key empty or comment out to disable Pushover notifications
PO_USER_KEY=""
PO_APP_KEY=""
# Determine logfile name
# use the label of the DVD/CD or else use empty.log
# this is required for udev events where there is no media available

View File

@@ -26,5 +26,15 @@ else
printf "\nIFTTT notification sent" >> "$LOG"
fi
#Notification via Pushover
#Trigger onl if variable is set
if [ -z "$PO_USER_KEY" ]; then
echo "Pusover notifications not enabled" >> "$LOG"
else
echo "Sending Pushover notification" >> "$LOG"
curl -s --form-string "token=$PO_APP_KEY" --form-string "user=$PO_USER_KEY" --form-string "message=$MSG" https://api.pushover.net/1/messages.json
echo "Pushover notification sent" >> "$LOG"
fi
} >> "$LOG"