Skip to content

Instantly share code, notes, and snippets.

@SkaTeMasTer
Created February 7, 2017 08:25
Show Gist options
  • Select an option

  • Save SkaTeMasTer/ad2bf39299d2371cd49f045eaa2dcf9f to your computer and use it in GitHub Desktop.

Select an option

Save SkaTeMasTer/ad2bf39299d2371cd49f045eaa2dcf9f to your computer and use it in GitHub Desktop.
Set permissions to allow it to execute: sudo chmod 777 piip.sh Open the crontab: sudo crontab -e Then paste at the bottom of the crontab: @reboot /home/pi/piip.sh
#!/bin/bash
ipVar=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
curl https://api.pushbullet.com/v2/pushes \
-u <paste_your_API_key_here>: \
-d device_iden="<device_ID_of_your_phone>" \
-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