Fix IP address script to work on OSX and Debian.