#! /bin/bash # script to determine my public IP address # deal with timeouts? #myIP=`dig +short @resolver1.opendns.com myip.opendns.com` #myIP=`curl -s ifconfig.me` #echo "$myIP" #curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//' # This works very well, and quickly !!! # http://serverfault.com/questions/89114/finding-the-public-ip-address-in-a-shell-script dig @resolver1.opendns.com myip.opendns.com +short