Skip to content

Instantly share code, notes, and snippets.

@dmpop
Created May 31, 2016 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmpop/e87b05f534001c34ad6b390d42cba520 to your computer and use it in GitHub Desktop.
Save dmpop/e87b05f534001c34ad6b390d42cba520 to your computer and use it in GitHub Desktop.
Send the current local IP address to dweet.io
#!/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