How do you check your external IP?

William Park opengeometry-FFYn/CNdgSA at public.gmane.org
Thu May 31 01:34:04 UTC 2012


On Sat, May 12, 2012 at 09:32:10PM -0400, William Park wrote:
> #!/bin/sh
> 
> EMAIL=<your-email-address>	# your email address
> NEW=~/checkip.new		# file containing new IP
> OLD=~/checkip.old		# file containing old IP
> 
> case $(( $RANDOM % 6 )) in
>     0) lynx -dump http://cfaj.freeshell.org/ipaddr.cgi ;;

Unfortunately, Chris's page has too many outages.  So, if you're using
my script, replace it with
    http://myip.dnsomatic.com/
-- 
William

>     1) lynx -dump http://checkip.dyndns.org/ | grep 'Current IP Address:' ;;
>     2) lynx -dump http://icanhazip.com/ ;;
>     3) lynx -dump http://ipchicken.com/ | grep 'Name Address:' | sed -e 's/.*: \([0-9-]\+\).*/\1/' -e 's/-/./g' ;;
>     4) lynx -dump http://myip.dnsdynamic.com/ ;;
>     5) lynx -dump http://whatismyip.com/ | grep 'Your IP Address Is:' ;;
> esac | tr -c -d '0-9.' > $NEW
> 
> if test -s $NEW && ! diff -q $NEW $OLD 1>/dev/null; then
>     mutt $EMAIL -s "newip = $(< $NEW)" < /dev/null
>     mv $NEW $OLD
> fi
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list