This site provides a simple mechanism to find your external public IP address.
|http://queryip.net/ip/||Returns the IP address of the interface it is retrieved from. It does not return an HTML page, just the text of the IP address with no markup and not even a trailing newline character.|
|http://queryip.net/url/||Returns the URL of the interface it is retrieved from. However, not all addresses have a URL, so unlisted addresses just return the IP address.|
These can be used in a shell script like this:
IP="$(curl -s http://queryip.net/ip/)"