Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to find a router's public non-static IP address' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to find a router's public non-static IP address
Authored by: gbilly on Jun 22, '06 08:12:18AM
Thanks for the hint. The "RR" line contained my local LAN IP not my external IP so I modified the script as follows:
ping -c 1 -R www.yahoo.com | \
sed -n '4p' | \
awk -F "(" '{print $2}' | \
sed 's/)//'

This is based on the 4th line ('4p') containing the usefull address. Can all of this be accomplished with sed?

Greg

[ Reply to This | # ]