Skip to content

Instantly share code, notes, and snippets.

@lyrl
Forked from outadoc/pushover
Created February 21, 2021 06:25
Show Gist options
  • Save lyrl/b6c8bd5ca2901e4b9804068c6ebaa2fa to your computer and use it in GitHub Desktop.
Save lyrl/b6c8bd5ca2901e4b9804068c6ebaa2fa to your computer and use it in GitHub Desktop.
Pushover Bash Script
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: ./pushover <message> [title]"
exit
fi
MESSAGE=$1
TITLE=$2
if [ $# -lt 2 ]; then
TITLE="`whoami`@${HOSTNAME}"
fi
APP_TOKEN="YOUR_TOKEN_HERE"
USER_TOKEN="YOUR_USER_ID_HERE"
wget https://api.pushover.net/1/messages.json --post-data="token=$APP_TOKEN&user=$USER_TOKEN&message=$MESSAGE&title=$TITLE" -qO- > /dev/null 2>&1 &

Pushover bash script

This is a bash script that will allow you to send a Pushover message very easily from a script or terminal.

Usage

Just put the script somewhere, and call it this way:

> ./pushover <message> [title]

So, for example:

> ./pushover "This is a test message from my Raspberry Pi."
> ./pushover "This is another message." "Wow, dude, nice title"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment