Skip to content

Instantly share code, notes, and snippets.

@outadoc
Last active October 24, 2024 12:31
Show Gist options
  • Save outadoc/848c74677b93dbe2e8f4 to your computer and use it in GitHub Desktop.
Save outadoc/848c74677b93dbe2e8f4 to your computer and use it in GitHub Desktop.

Revisions

  1. outadoc renamed this gist Aug 24, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. outadoc created this gist May 3, 2014.
    15 changes: 15 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # Pushover bash script

    This is a bash script that will allow you to send a [Pushover](http://pushover.net) 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"

    18 changes: 18 additions & 0 deletions pushover
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/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 &