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:
parent
4ee847b92a
commit
db01ce6730
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue