Host file now lists 127.0.0.1 localhost, 0.0.0.0 the others.
authorSteven Black <redacted>
Tue, 6 Oct 2015 21:05:09 +0000 (17:05 -0400)
committerSteven Black <redacted>
Tue, 6 Oct 2015 21:05:09 +0000 (17:05 -0400)
updateHostsFile.py

index 88ab00641d464858b22e9cdb704468d6bd0889de..091bc25e5060e05a5c73fe719d0989da176c6ea3 100644 (file)
@@ -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):
git clone https://git.99rst.org/PROJECT