Update to include preamble handling
authorZaur Molotnikov <redacted>
Fri, 30 Oct 2015 10:13:21 +0000 (11:13 +0100)
committerZaur Molotnikov <redacted>
Fri, 30 Oct 2015 10:13:21 +0000 (11:13 +0100)
.gitignore [new file with mode: 0644]
myhosts [new file with mode: 0644]
updateHostsFile.py

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1baeb4f
--- /dev/null
@@ -0,0 +1 @@
+myhosts
diff --git a/myhosts b/myhosts
new file mode 100644 (file)
index 0000000..e69de29
index a78825ddb9b979d03de5da07e23d8ba510be15ad..18a797db904e0f2f0edfa892b236cb9a022837a7 100755 (executable)
@@ -277,6 +277,12 @@ def writeOpeningHeader(finalFile):
        writeData(finalFile, '\n')
        writeData(finalFile, '127.0.0.1 localhost\n')
        writeData(finalFile, '\n')
+       
+       preamble = os.path.join(BASEDIR_PATH, "myhosts");
+       if os.path.isfile(preamble):
+               with open(preamble, "r") as f:
+                       writeData(finalFile, f.read());
+       
        finalFile.write(fileContents)
 
 def updateReadme(numberOfRules):
git clone https://git.99rst.org/PROJECT