Neat script! On a related note and something I use more frequently :
curl ifconfig.me
Easy way to find the public IP :)
Easy way to find the public IP :)
Returns public IP address, ISO country code, User-Agent string, and a new line (to ensure the terminal prompt doesn't get shifted after displaying the response).[0][1]
- [0] https://use.ipaddy.net - [1] https://github.com/oedmarap/ipaddy