Adde base conf loader
Remove TOTO
This commit is contained in:
parent
a6d5f3026d
commit
fca78832d8
43
HTTPy.py
43
HTTPy.py
@ -21,7 +21,48 @@ running = 1
|
|||||||
pingOn = "p"
|
pingOn = "p"
|
||||||
whoOn = "W"
|
whoOn = "W"
|
||||||
phrases = ["ping", "whois", "quit", "clear", "help", "nameserver"]
|
phrases = ["ping", "whois", "quit", "clear", "help", "nameserver"]
|
||||||
|
|
||||||
|
def openFile(filename):
|
||||||
|
try:
|
||||||
|
myfile = open(filename)
|
||||||
|
except Exception as E:
|
||||||
|
print E
|
||||||
|
print 'Creating default config file'
|
||||||
|
myfile = open(filename, 'w')
|
||||||
|
myfile.write('records=A:MX:TXT:NS:SRV:SOA\n')
|
||||||
|
myfile.write('subdomains=www:mail')
|
||||||
|
myfile.close()
|
||||||
|
return 1
|
||||||
|
return myfile
|
||||||
|
|
||||||
|
def closeFile(fileObj):
|
||||||
|
try:
|
||||||
|
fileObj.close()
|
||||||
|
except Exception as E:
|
||||||
|
print E
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
#Check and see if python can do pairs
|
||||||
|
def splitLines(confline):
|
||||||
|
tmpLine = confline.split('\n')
|
||||||
|
retval = []
|
||||||
|
for line in tmpLine:
|
||||||
|
if line != '':
|
||||||
|
tmpLines = line.split('=')
|
||||||
|
retval.append(tmpLines[1].split(':'))
|
||||||
|
return retval
|
||||||
|
|
||||||
|
testFile = openFile('.httpy')
|
||||||
|
test = testFile.read()
|
||||||
|
test1, test2 = splitLines(test)
|
||||||
|
|
||||||
|
for t1 in test1:
|
||||||
|
print "dig " + t1
|
||||||
|
|
||||||
|
for t2 in test2:
|
||||||
|
print "dig " + t2
|
||||||
|
closeFile(testFile)
|
||||||
|
|
||||||
def printHelp():
|
def printHelp():
|
||||||
print bcolors.BLUE + "========================================================"
|
print bcolors.BLUE + "========================================================"
|
||||||
print "= help - This screen ="
|
print "= help - This screen ="
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user