1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps-admin.git synced 2025-02-12 18:41:52 +00:00

Fix multiples FW rules

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-06-12 19:43:09 +02:00
parent 4ee847b92a
commit db01ce6730

View file

@ -619,9 +619,9 @@ def shorewall_add_port(user, port, proto, name, fwtype='ACCEPT', source_dip='',
n.write(line) n.write(line)
else: else:
comment = '' comment = ''
if source_dip == '': if source_dip != '':
comment = ' to ' + source_dip comment = ' to ' + source_dip
if dest_ip == '': if dest_ip != '':
comment = comment + ' from ' + dest_ip comment = comment + ' from ' + dest_ip
if (fwtype == 'ACCEPT' and not '# OMR ' + user.username + ' open ' + name + ' port ' + proto + comment in line): if (fwtype == 'ACCEPT' and not '# OMR ' + user.username + ' open ' + name + ' port ' + proto + comment in line):
n.write(line) n.write(line)
@ -698,9 +698,9 @@ def shorewall6_add_port(user, port, proto, name, fwtype='ACCEPT', source_dip='',
n.write(line) n.write(line)
else: else:
comment = '' comment = ''
if source_dip == '': if source_dip != '':
comment = ' to ' + source_dip comment = ' to ' + source_dip
if dest_ip == '': if dest_ip != '':
comment = comment + ' from ' + dest_ip comment = comment + ' from ' + dest_ip
if fwtype == 'ACCEPT' and not port + '# OMR ' + user.username + ' open ' + name + ' port ' + proto + comment in line: if fwtype == 'ACCEPT' and not port + '# OMR ' + user.username + ' open ' + name + ' port ' + proto + comment in line:
n.write(line) n.write(line)