Skip to content

Instantly share code, notes, and snippets.

@yyolk
Last active December 16, 2015 16:40
Show Gist options
  • Save yyolk/5465006 to your computer and use it in GitHub Desktop.
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
#!/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