Skip to content

Instantly share code, notes, and snippets.

@mkorthof
Last active January 19, 2018 22:48
Show Gist options
  • Save mkorthof/a39fe7e2416e9fa2002bb5c0bd8e8062 to your computer and use it in GitHub Desktop.
Save mkorthof/a39fe7e2416e9fa2002bb5c0bd8e8062 to your computer and use it in GitHub Desktop.
ipv6test - test/show your ipv6 addr
#!/bin/sh
ARGS=""
if [ "$interface" ]; then ARGS="$ARGS --interface $interface"; fi
echo
for i in ipv6.test-ipv6.com/ip/\?callback=\?\&asn=1 whatismyv6.com ipv6-test.com ipv6now.com.au ipv6-speedtest.net testmyipv6.com; do
echo "Testing $i:"
#lynx -connect_timeout=5 -read_timeout=5 -dump http://$i | grep -A 2 "\(Your\? are\|Your IP\|Welcome\)" | grep -v "\(\[.*\]\|FAQ\)" | sed -e '/^$/d' -e 's/ //g'
curl -6 --connect-timeout 5 -s http://$i $ARGS | sed -e 's/<[^>]*>/ /g' | grep -A 1 "\(Your\? are\|Your IP\|Welcome\|callback\)" | grep -v "\(\[.*\]\|FAQ\|[yY]our\ browser\)"
echo
done | sed -e 's/\( *\|[(){}]\|\"[:,]\"\|"\"\)/ /g' -e '/^\( \|\r\|--\)$/d'
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment