Closed ryankashi closed 8 years ago
http://stackoverflow.com/questions/9481419/how-can-i-get-the-public-ip-using-python2-7 Just do: from urllib2 import urlopen my_ip = urlopen('http://ip.42.pl/raw').read()
Automatically make caches take the public ip address via doing: python cache.py public If public, do the above for the address.
In case we decide to fetch the ip address in the shell script, this single line will return the public address: curl ifconfig.co
http://stackoverflow.com/questions/9481419/how-can-i-get-the-public-ip-using-python2-7 Just do: from urllib2 import urlopen my_ip = urlopen('http://ip.42.pl/raw').read()
Automatically make caches take the public ip address via doing: python cache.py public If public, do the above for the address.