Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

update for priority 2 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions notify_by_pushover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@
# -w Warning notification sound. The script will look for the text 'WARNING' in the notification title, and use this sound if found.
# -c Critical notification sound. The script will look for the text 'CRITICAL' in the notification title, and use this sound if found.
# -o OK notification sound. The script will look for the text 'OK' in the notification title, and use this sound if found.
# -e Expire parameter , required for nofication priority 2
# -r Retry parameter , required for nofication priority 2

# Example:
# ./notify_by_pushover.sh -u r5j7mjYjd -a noZ9KuR5T -s 'spacealarm' -t "server.pretendco.com" -m "DISK WARNING - free space: /dev/disk0s2 4784 MB"


while getopts "u:a:t:m:p:s:w:c:o:" optionName; do
while getopts "u:a:t:m:p:s:w:c:o:e:r" optionName; do
case "$optionName" in
u) userKey=( "$OPTARG" );;
a) appToken=( "$OPTARG" );;
Expand All @@ -54,6 +56,8 @@ s) sound=( "$OPTARG" );;
w) warnSound=( "$OPTARG" );;
c) critSound=( "$OPTARG" );;
o) okSound=( "$OPTARG" );;
e) expire=( "$OPTARG" );;
r) retry=( "$OPTARG" );;

esac
done
Expand All @@ -78,6 +82,8 @@ curl -F "token=$appToken" \
-F "message=$message" \
-F "sound=$sound" \
-F "$priorityString" \
-F "expire=$expire" \
-F "retry=$retry" \
https://api.pushover.net/1/messages

exit 0
exit 0