Created
February 7, 2017 08:25
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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