Skip to content

Instantly share code, notes, and snippets.

@outadoc
Created May 22, 2015 17:36
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save outadoc/189bd3ccbf5d6e0f39e4 to your computer and use it in GitHub Desktop.
Save outadoc/189bd3ccbf5d6e0f39e4 to your computer and use it in GitHub Desktop.
Pushbullet bash script
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 <message> [title]"
exit
fi
MESSAGE=$1
TITLE=$2
if [ $# -lt 2 ]; then
TITLE="`whoami`@${HOSTNAME}"
fi
ACCESS_TOKEN="YOUR_ACCESS_TOKEN_HERE"
curl -s -u $ACCESS_TOKEN: -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "'"$TITLE"'", "body": "'"$MESSAGE"'"}' >/dev/null 2>&1
@frankdors
Copy link

frankdors commented Aug 10, 2018

Alternative mode, allow send more complex text with special caracteres

curl -u $ACCESS_TOKEN: https://api.pushbullet.com/v2/pushes -d type=note -d title="$TITLE" -d body="$MESSAGE" >/dev/null 2>&1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment