Commit 7eb4e611 authored by Benjamin Graillot's avatar Benjamin Graillot
Browse files

Open /etc/nftables.conf in write mode

parent 58c1a1bc
......@@ -204,6 +204,6 @@ if __name__ == "__main__":
if args.export:
print(template.render(nat=nat, ports_openings=ports_openings, ports_openings_adh=ports_openings_adh))
else:
with open('/etc/nftables.conf') as nftables:
with open('/etc/nftables.conf', 'w') as nftables:
nftables.write(template.render(nat=nat, ports_openings=ports_openings, ports_openings_adh=ports_openings_adh))
subprocess.run(['systemctl', 'reload', 'nftables'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment