My computers are sitting behind a router/firewall. How do I programmatically find out what my external IP address is. I can use http://www.whatsmyip.org/ for ad-hoc queries,
curl ifconfig.me
or
curl ifconfig.me/ip
Incase you don't have curl installed,
wget ifconfig.me/ip 2>/dev/null && cat ip
Hope this helps.