###################################### #! /bin/sh # # So you want to know your IP :-) # # Let's check some websites .... # # repo@beginnerslinux.org # # http://beginnerslinux.org # ###################################### echo "Using lynx and http://www.whatismyip.com is : " lynx -dump http://whatismyip.com | awk '/Your IP Is/{print $NF}' echo "Using lynx and http://www.mediacollege.com/internet/utilities/show-ip.shtml : " lynx -dump http://www.mediacollege.com/internet/utilities/show-ip.shtml \ | awk '/is:/{print $NF}' echo "Using wget and http://cfaj.freeshell.org/ipaddr.cgi" wget -O- http://cfaj.freeshell.org/ipaddr.cgi 2>/dev/null echo "Using perl and http://whatismyip.com" perl -MLWP::Simple -le '$_=get q(http://www.formyip.com/); \ print $1 if /IP is ((\d{1,3}\.){3}\d{1,3})/' echo "Further some other sites using lynx in case the others are down :-)" lynx -dump http://www.formyip.com/ | awk '/IP is/{print $NF}' lynx -dump http://www.showipaddress.com/ \ | awk '/IP address:/{print $NF}' lynx -dump http://www.auditmypc.com/whats-my-ip.asp \ | awk '/current IP/{print $NF}' lynx -dump http://www.edpsciences.org/htbin/ipaddress \ | awk '/IP address is/{print $NF}' lynx -dump http://www.pcmesh.com/ip-check.cgi \ | awk '/REMOTE_ADDR/{print $2}' echo "" echo " Enjoy"