mirror of
https://github.com/nikdoof/rpzhole.git
synced 2025-12-23 06:39:24 +00:00
Fix RNDC reload
This commit is contained in:
4
rpzhole
4
rpzhole
@@ -73,7 +73,7 @@ def parse_blacklist(format, filename=None, fobj=None):
|
||||
|
||||
def write_rpz(hosts, filename, origin='rpz.black.hole'):
|
||||
"""Produces a basic Bind RPZ zone file from a list of hosts"""
|
||||
rpz_header = ["$TTL 60", "$ORIGIN %s" % origin, "@ SOA nonexistent.nodomain.none. dummy.nodomain.none. %d 12h 15m 3w 2h" % time.time(), "NS nonexistant.nodomain.none"]
|
||||
rpz_header = ["$TTL 60", "$ORIGIN %s" % origin, "@ SOA nonexistent.nodomain.none. dummy.nodomain.none. %d 12h 15m 3w 2h" % time.time(), "@ NS nonexistant.nodomain.none"]
|
||||
with open(filename, 'wb') as fobj:
|
||||
for line in rpz_header:
|
||||
fobj.write('%s\n' % line)
|
||||
@@ -152,7 +152,7 @@ def main():
|
||||
# reload RPZ
|
||||
if args.reloadzone:
|
||||
_logger.info('Informing Bind to reload the zone')
|
||||
res = subprocess.call('rndc reload %s' % config['origin'])
|
||||
res = subprocess.call('rndc reload %' % config['origin'], shell=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user