I use this tool to get my current Global IP address as I need its value to whitelist Home's IP on my company firewall.I needed this tool since I work from home now and my ISP doesn't provide static IPs.
the tool not only get the IP address it also get geolocation info of your IP address using ipify. they have a nice free plan of 1000 request per month which is nice for personal use. so if you want the Geolocation part to work please do the following:
- create an account at ipify
- get the apiKey of your own
- rename example.env file to .env file and past your apiKey there on there
otherwise just ignore that part.
- Download Bin from here
- copy or link it to your bin to use it as a program copy
cp main /usr/local/bin/myip
link
ln -s $PWD/main /usr/local/bin/myip
- clone the repo
git clone [email protected]:mo7amd/myip.git
- change dir to it
cd myip
- build the package
go build main.go
- copy or link it to your bin to use it as a program copy
cp main /usr/local/bin/myip
link
ln -s $PWD/main /usr/local/bin/myip
I personally prefer the link version as it keep the bin updated when I rebuild the package, you got the options suit yourself.