From c506b3401c97d26e2768cea1a15538771cc6432a Mon Sep 17 00:00:00 2001 From: Rupert Edwards Date: Sat, 30 May 2020 11:58:26 -0400 Subject: [PATCH] [Fixed] Getting Public IP, added fail-over --- toriptables2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toriptables2.py b/toriptables2.py index 581a4f3..9c27bef 100755 --- a/toriptables2.py +++ b/toriptables2.py @@ -71,9 +71,11 @@ DNSPort %s except URLError: sleep(5) print(" [\033[93m?\033[0m] Still waiting for IP address...") + except ValueError: + break print if not my_public_ip: - my_public_ip = getoutput('wget -qO - v4.ifconfig.co') + my_public_ip = getoutput('wget -qO - ifconfig.me') if not my_public_ip: exit(" \033[91m[!]\033[0m Can't get public ip address!") print(" {0}".format("[\033[92m+\033[0m] Your IP is \033[92m%s\033[0m" % my_public_ip))