fix nftables (firewall) mechanism

This commit is contained in:
2024-03-05 11:16:27 +01:00
parent 42d80f9567
commit 6f025880ce
3 changed files with 36 additions and 3 deletions

View File

@ -423,7 +423,8 @@ class Service:
with open('f{FIREWALL_CONF}.tmp', 'w') as f:
f.write(content.replace(prevline, line))
os.rename('f{FIREWALL_CONF}.tmp', FIREWALL_CONF)
unix_cmd('systemctl enable --now nftables')
unix_cmd('systemctl restart nftables')
unix_cmd('systemctl enable nftables')
else:
print('need sudo rights to modify firewall')