From ecf2f1a092ce0aeceb6766aa7573fdfdabbc4dc0 Mon Sep 17 00:00:00 2001 From: clamsawd Date: Tue, 27 Oct 2015 19:40:06 +0100 Subject: [PATCH] os.popen('curl -s icanhazip.com').read() --- ip2e-daemon.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ip2e-daemon.py b/ip2e-daemon.py index 194275b..de7b298 100755 --- a/ip2e-daemon.py +++ b/ip2e-daemon.py @@ -160,9 +160,12 @@ while PublicIP <= 2: while GetCurrentIP <= 2: print ("[ip2e-daemon] IP Updating...") os.system("echo [ip2e-daemon] IP Updating... >> ip2e.log") - NewIP = os.popen('curl -s http://ip.appspot.com/').read() - #NewIP = os.popen('curl -s ifconfig.me').read() - #NewIP = os.popen('wget -qO- icanhazip.com').read() + NewIPRaw = os.popen('curl -s icanhazip.com').read() + NewIP = NewIPRaw.strip() + #NewIP = os.popen('curl -s http://ip.appspot.com/').read() + #NewIP = os.popen('curl -s ident.me').read() + #NewIPRaw = os.popen('curl -s ifconfig.me').read() + #NewIP = NewIPRaw.strip() if NewIP != "": GetCurrentIP += 2 else: