From 40cd08ca0b6faac4397e180ee4fffc10020e9b22 Mon Sep 17 00:00:00 2001 From: Glen Pit-Pladdy Date: Tue, 11 Apr 2017 12:29:28 +0100 Subject: [PATCH] Make comments use correct comment character --- py-hole-bind9RPZ | 2 +- py-hole-dnsmasq | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 )