Created
September 11, 2022 10:41
-
-
Save tomazzaman/1622b8bcf28ba324df4cd05a4b5ad053 to your computer and use it in GitHub Desktop.
Messaging script for pushover.net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Messaging script for pushover.net (make sure you have an account) | |
# put this somewhere in your $PATH and make it executable | |
if [ $# -eq 0 ]; then | |
echo "Usage: pushover <title> <message>" | |
echo "Example: $ pushover \"This is the title\" \"This is a nice message\"" | |
exit | |
fi | |
# Token information | |
API_TOKEN="[insert app token]" | |
USER_KEY="[insert your user key]" | |
TITLE=$1 | |
MESSAGE=$2 | |
curl -X POST \ | |
--data-urlencode "token=${API_TOKEN}" \ | |
--data-urlencode "user=${USER_KEY}" \ | |
--data-urlencode "title=${TITLE}" \ | |
--data-urlencode "message=${MESSAGE}" \ | |
-H "application/x-www-form-urlencoded" \ | |
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