lmi2jw
Last Updated: February 25, 2016
·
613
· barnettjw

Get external IP in a script

Ever need to get the external IP address of the server a script is running on?

localhost [~] $ curl http://icanhazip.com
129.121.176.228

There's also the more professional looking (yet less fun) alternative URL of http://ifconfig.me/ip

Filed Under