Skip to content

Instantly share code, notes, and snippets.

@nigamankit7
Created November 9, 2014 16:04
Show Gist options
  • Save nigamankit7/a27e5f395d907a44942b to your computer and use it in GitHub Desktop.
Save nigamankit7/a27e5f395d907a44942b to your computer and use it in GitHub Desktop.
When Raspberry Pi starts it will send it IP via PushBullet notification
#!/bin/bash
ipVar=$(/sbin/ifconfig $(netstat -nr | tail -1 | awk '{print $NF}') | awk -F: '/inet /{print $2}' | cut -f1 -d ' ')
curl https://api.pushbullet.com/v2/pushes \
-u <API>: \
-d device_iden="<ID>" \
-d type="note" \
-d title="Pi IP address" \
-d body=$ipVar \
-X POST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment