3 # http://www.linuxquestions.org/questions/linux-networking-3/how-can-i-get-my-external-ip-address-from-behind-a-nat-333878/
8 until (( xc
== 0 )) ; do
10 case $
(( RANDOM
% 5 )) in
12 0) ip
=$
(wget
-t 2 -T 5 -q -O- http
://showip.codebrainz.ca
/) ;;
13 # 1) ip=$(wget -t 2 -T 5 -q -O- http://www.whatismyip.com/automation/n09230945.asp) ;;
14 2) ip
=$
(wget
-t 2 -T 5 -q -O- http
://www.showmyip.com
/simple
/) ;;
15 3) ip
=$
(wget
-t 2 -T 5 -q -O- http
://cfaj.freeshell.org
/ipaddr.cgi
) ;;
16 4) ip
=$
(wget
-t 2 -T 5 -q -O- https
://secure.informaction.com
/ipecho
/) ;;
17 1) ip
=$
(wget
-t 2 -T 5 -q -O- http
://icanhazip.com
/) ;;
25 #echo -n "${ip//[^0-9.]}" #if you don't want a trailing newline
26 echo "$ip" #if you want or don't mind newlines