From 245e98d8b8e42a701a9768fce7d63fdcf7519949 Mon Sep 17 00:00:00 2001 From: Benajmyn Love Date: Wed, 26 Jul 2017 18:36:03 +1000 Subject: [PATCH] Made whois less intrusive --- HTTPy.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/HTTPy.py b/HTTPy.py index 1137f08..4c1a251 100755 --- a/HTTPy.py +++ b/HTTPy.py @@ -108,17 +108,16 @@ def whois(inDomain): def dig(inDomain, record): dig = subprocess.check_output(["dig", record, "+short", inDomain]) - print "========================================================" #ADD REST OF DIGS + print "========================================================" test = dig.split("\n") - #print record, test[0] - iterate(test, record) #fix up mutiple record types... + iterate(test, record) return test def ipLookup(inDomain): host = "N/A" ipLook = subprocess.check_output(["geoiplookup", inDomain]) try: - host = subprocess.check_output(["host", inDomain]) #Do exit status check... + host = subprocess.check_output(["host", inDomain]) returncode = 0 except subprocess.CalledProcessError as e: output = e.output @@ -156,13 +155,11 @@ while running == 1: print "========================================================" ipPing(inInput) else: - pass + if whoOn == "W": + whois(inInput) else: - if whoOn == "W": - whois(inInput) - else: - pass + #Condense dig calls dig(inInput, "A") dig(inInput, "MX")