Last active
July 28, 2016 18:23
-
-
Save gvoysey/d1dc51840b71ad940369 to your computer and use it in GitHub Desktop.
Texts you your IP address (useful for headless linux boxes, raspberry pis, etc)
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 | |
myIP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') | |
commandString="curl http://textbelt.com/text -d number=1111111111 -d \"message=$myIP\"" | |
$(eval $commandString) | |
#call this script from /etc/rc.local with (eval "/path/to/thisscript"); get a text every time your machine reboots with the new IP. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment