Skip to content

Instantly share code, notes, and snippets.

@TheNoim
Forked from outadoc/pushbullet.sh
Last active January 7, 2018 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheNoim/bec30441753c135a36805caee3e0294d to your computer and use it in GitHub Desktop.
Save TheNoim/bec30441753c135a36805caee3e0294d 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment