diff --git a/to-rpz/dnsmasq_rpz_argv.py b/to-rpz/dnsmasq_rpz_argv.py index e4540b0..1d7f6bb 100644 --- a/to-rpz/dnsmasq_rpz_argv.py +++ b/to-rpz/dnsmasq_rpz_argv.py @@ -12,8 +12,10 @@ lst = [] with open(infile, 'r') as f: for line in f: for word in a: - if word in line: - line = line.replace(word,'') + if word in line and not line.startswith('#'): + line = line.replace(word,'') + else: + line = line.replace(line, line) lst.append(line) f.close() with open(infile, 'w') as f: diff --git a/to-rpz/host_rpz_argv.py b/to-rpz/host_rpz_argv.py index 1d12ae6..a689bf6 100644 --- a/to-rpz/host_rpz_argv.py +++ b/to-rpz/host_rpz_argv.py @@ -12,8 +12,10 @@ lst = [] with open(infile, 'r') as f: for line in f: for word in a: - if word in line: + if word in line and not line.startswith('#'): line = line.replace(word,'') + else: + line = line.replace(line, line) lst.append(line) f.close() with open(infile, 'w') as f: diff --git a/to-rpz/unbound_rpz_argv.py b/to-rpz/unbound_rpz_argv.py index 574ac34..bb2870c 100644 --- a/to-rpz/unbound_rpz_argv.py +++ b/to-rpz/unbound_rpz_argv.py @@ -13,8 +13,10 @@ lst = [] with open(infile, 'r') as f: for line in f: for word in a: - if word in line: + if word in line and not line.startswith('#'): line = line.replace(word,'') + else: + line = line.replace(line, line) lst.append(line) f.close() with open(infile, 'w') as f: