diff --git a/py-hole-bind9RPZ b/py-hole-bind9RPZ index bbf05a5..d14e649 100755 --- a/py-hole-bind9RPZ +++ b/py-hole-bind9RPZ @@ -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() diff --git a/py-hole-dnsmasq b/py-hole-dnsmasq index 1715065..2511538 100755 --- a/py-hole-dnsmasq +++ b/py-hole-dnsmasq @@ -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 )