Skip to content

Instantly share code, notes, and snippets.

@crahan
Created August 25, 2014 22:21
Show Gist options
  • Save crahan/2f1abb362d55b1d489b4 to your computer and use it in GitHub Desktop.
Save crahan/2f1abb362d55b1d489b4 to your computer and use it in GitHub Desktop.
Get WAN IP
#!/bin/bash
ext_ip=`/usr/bin/curl --silent http://checkip.dyndns.org | awk '{printf $6}' | cut -f 1 -d "<" | tr -d 'n'`
echo $ext_ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment