5 ms·
Or, even better: # Get my IP address by checking ifconfig.me curl -s ifconfig.me The less work you have to do, the better :) NOTE: If you visit ifconfig.
by qu4z-2 14y ago
Or, even better:
# Get my IP address by checking ifconfig.me
curl -s ifconfig.me
The less work you have to do, the better :)
NOTE: If you visit ifconfig.me with your browser you get an html page full of text, but with the curl useragent it just returns the ip-address
- Someone 14y agoThat also introduces a dependency on ifconfig.me. If your script contains four or five such 'less work you have to do', I bet it breaks within a year.
- stouset 14y agoAll of the above scripts had external dependencies.
- qu4z-2 14y agoObviously that's a consideration, but this script has removed a dependency on checkip.dyndns.org. You could make the case that that's more likely to stay up, which is a valid decision. Alternatively, you could create a "whereami" that returns the ip, and use that in your scripts. If ifconfig.me goes down for good, you have to change the url in one place. I'm sure you'll cope.