Skip to content

Instantly share code, notes, and snippets.

@Kerollmops
Created December 9, 2023 10:10
Show Gist options
  • Save Kerollmops/a305552d7cfddc01625cfd065478e1f6 to your computer and use it in GitHub Desktop.
Save Kerollmops/a305552d7cfddc01625cfd065478e1f6 to your computer and use it in GitHub Desktop.
A very simple bash/shell function to push messages through pushover
# Create an API KEY there: https://pushover.net/apps/build
# Find your user TOKEN here: https://pushover.net
#
# Note that the `title` field is optional and don't forget to put double quotes
# around your argument when calling this function.
#
# Here is a small example of pipping logs through pushover:
#
# nohup tail -f nohup.out | while read l; do pushover "$l"; done &
#
function pushover {
curl -s -F "token=YOUR_TOKEN_HERE" \
-F "user=YOUR_USER_KEY_HERE" \
-F "title=YOUR_TITLE_HERE" \
-F "message=$1" 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