Last active
December 16, 2015 16:40
-
-
Save yyolk/5465006 to your computer and use it in GitHub Desktop.
usage: `./pushalert.sh` will ping devices, `./pushalert.sh $(date)` will push (evaluated) text
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
#!/bin/bash | |
#use all arguments after self as the message, or default to a standard ping | |
if [[ -z "$1" ]]; then | |
MESSAGE="Ping!" | |
else | |
MESSAGE="$@" | |
fi | |
APPTOKEN="MY_PUSHOVER_APP_TOKEN" | |
USERTOKEN="MY_PUSHOVER_USER_TOKEN" | |
curl --data "token=$APPTOKEN&user=$USERTOKEN&message=$MESSAGE" 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