From 4998b31f24460b712f8ab2a793b011babbbbc8df Mon Sep 17 00:00:00 2001 From: Steven Black Date: Tue, 6 Oct 2015 17:05:09 -0400 Subject: [PATCH] Host file now lists 127.0.0.1 localhost, 0.0.0.0 the others. --- updateHostsFile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/updateHostsFile.py b/updateHostsFile.py index 88ab00641..091bc25e5 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -164,6 +164,7 @@ def removeDups(mergeFile): mergeFile.seek(0) # reset file pointer hostnames = set() + hostnames.add("localhost") for line in mergeFile.readlines(): if line[0].startswith("#") or re.match(r'^\s*$', line[0]): finalFile.write(line) #maintain the comments for readability @@ -218,6 +219,9 @@ def writeOpeningHeader(finalFile): finalFile.write('#\n') finalFile.write('# Merging these sources produced ' + str(numberOfRules) + ' unique entries\n') finalFile.write('# ===============================================================\n') + finalFile.write('\n') + finalFile.write('127.0.0.1 localhost\n') + finalFile.write('\n') finalFile.write(fileContents) def updateReadme(numberOfRules):