Make comments use correct comment character

This commit is contained in:
Glen Pit-Pladdy
2017-04-11 12:29:28 +01:00
parent 1b24089ad3
commit 40cd08ca0b
2 changed files with 3 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ seenbefore = {}
commentstart = ';' # for bind
def addcomment ( comment ):
global outputdata
outputdata += ";%s\n" % comment
outputdata += "%s%s\n" % (commentstart,comment)
def addhost ( host ):
global outputdata
host = host.lower().strip()

View File

@@ -59,7 +59,7 @@ seenbefore = {}
commentstart = '#' # for hosts / dnsmasq
def addcomment ( comment ):
global outputdata
outputdata += ";%s\n" % comment
outputdata += "%s%s\n" % (commentstart,comment)
def addhost ( host ):
global outputdata
host = host.lower().strip()
@@ -140,6 +140,7 @@ if 'localblacklist' in config:
for host in config['localblacklist']:
addhost ( host )
# write the config['hostsfile'] file
with open ( config['hostsfile']+'.TMP', 'wt' ) as f:
f.write ( outputdata )