title: Methods to detect public IP address in bash
body: <p>As part of an installation script, I want to make an "educated guess" about the machines <strong>public</strong> IP address. It should be as robust as possible, working on a variety of hosts and platforms. Here is an example: </p>
  
  <p><a href="https://gist.github.com/4669037">https://gist.github.com/4669037</a></p>
  
  <p>This script uses 3 methods and then defaults to the value of <code>/etc/hostname</code>. I have only tested this on Ubuntu so far. Will this be likely to work on other distributions? And are there additional methods that I could add?</p>