hopes and dreams
This commit is contained in:
parent
7d20140563
commit
266ba314b3
13
HTTPy.py
13
HTTPy.py
@ -148,9 +148,13 @@ def iterate(inArray, pre):
|
||||
|
||||
|
||||
def iterateMX(inArray, pre):
|
||||
global inInput
|
||||
count = 0
|
||||
while count != len(inArray) - 1:
|
||||
tmp = inArray[count].split(' ')
|
||||
if (len(tmp) == 1):
|
||||
pass
|
||||
else:
|
||||
tmpVal = isCNAME(tmp[1])
|
||||
print indent + bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET + " -> " + bcolors.GREEN + tmpVal[0] + bcolors.RESET
|
||||
count = count + 1
|
||||
@ -194,7 +198,7 @@ def dig(inDomain, record):
|
||||
dig = subprocess.check_output(["dig", record, "+short", inDomain])
|
||||
except Exception as e:
|
||||
dig = "error"
|
||||
print str(e)
|
||||
#print str(e)
|
||||
print "========================================================"
|
||||
test = dig.split("\n")
|
||||
iterate(test, record)
|
||||
@ -205,7 +209,7 @@ def newdig(inDomain, record, sub=""):
|
||||
dig = subprocess.check_output(["dig", record, "+short", inDomain])
|
||||
except Exception as e:
|
||||
dig = "error"
|
||||
print str(e)
|
||||
#print str(e)
|
||||
#print "========================================================"
|
||||
test = dig.split("\n")
|
||||
#iterate(test, record)
|
||||
@ -238,7 +242,10 @@ def getInput():
|
||||
if inInput == "quit":
|
||||
running = 0
|
||||
|
||||
def isCNAME(CNAME):
|
||||
def isCNAME(CNAME, DOMAIN=""):
|
||||
if (DOMAIN == CNAME):
|
||||
return 0
|
||||
else:
|
||||
retval = newdig(CNAME, "A")
|
||||
return retval[0]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user