make parent of firewall config when it does not exists

it is the .config directory
This commit is contained in:
2026-05-06 10:26:00 +02:00
parent b8642fdb91
commit ac446d10d4
+1
View File
@@ -314,6 +314,7 @@ def change_firewall(router_ports, main_ports, execute=None):
else:
main_ports.add(22) # always add ssh
if execute:
FIREWALL_MAIN.parent.mkdir(parents=True, exist_ok=True)
with open(FIREWALL_MAIN, 'w') as fil:
fil.write(' '.join(str(p) for p in sorted(main_ports)))
fil.write('\n')