Created
May 31, 2016 09:02
-
-
Save dmpop/e87b05f534001c34ad6b390d42cba520 to your computer and use it in GitHub Desktop.
Send the current local IP address to dweet.io
This file contains 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 | |
ping -c1 google.com &>/dev/null | |
if [ $? -eq 0 ]; then | |
IP=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') | |
curl "https://dweet.io/dweet/for/$THING?IP=$IP" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment