Skip to content

Instantly share code, notes, and snippets.

@mariodian
Created November 14, 2021 01:49
Show Gist options
  • Save mariodian/fa10307a267b2d616b64bababf44e383 to your computer and use it in GitHub Desktop.
Save mariodian/fa10307a267b2d616b64bababf44e383 to your computer and use it in GitHub Desktop.
Send pushover notifications
#!/bin/bash
TITLE=$1
MESSAGE=$2
PRIORITY=${3:-0}
RETRY=${4:-60}
EXPIRE=${5:-300}
if [ -z "$TITLE" ]; then
echo "No title provided"
exit 1
fi
if [ -z "$MESSAGE" ]; then
echo "No message provided"
exit 1
fi
TOKEN=<token>
USER=<user>
DEVICE=<device>
curl -s \
--form-string "token=$TOKEN" \
--form-string "user=$USER" \
--form-string "message=$MESSAGE" \
--form-string "title=$TITLE" \
--form-string "device=$DEVICE" \
--form-string "html=1" \
--form-string "priority=$PRIORITY" \
--form-string "retry=$RETRY" \
--form-string "expire=$EXPIRE" \
https://api.pushover.net/1/messages.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment