make parent of firewall config when it does not exists
it is the .config directory
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user