mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
Firewall: Aliases - read before write in update_tables.py (minor stylefix)
This commit is contained in:
parent
935c64295b
commit
bb4cddda35
@ -99,7 +99,7 @@ if __name__ == '__main__':
|
||||
alias_content_str = '\n'.join(sorted(alias_content))
|
||||
if not os.path.isfile(alias_filename) or alias_content_str != alias.read_alias_file(alias_filename):
|
||||
# read before write, only save when the contents have changed
|
||||
open('/var/db/aliastables/%s.txt' % alias_name, 'w').write(alias_content_str)
|
||||
open(alias_filename, 'w').write(alias_content_str)
|
||||
|
||||
# list current alias content when not trying to update a targetted list
|
||||
alias_pf_content = list(PF.list_table(alias_name)) if to_update is None else alias_content
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user