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

Fix get shorewall rules

This commit is contained in:
Ycarus 2020-03-09 15:52:15 +01:00
parent 2aa968920e
commit b9d326cf8f

View file

@ -1044,12 +1044,12 @@ def shorewall_list(*, params: ShorewallListparams, current_user: User = Depends(
if params.ipproto == 'ipv4':
with open('/etc/shorewall/rules', 'r') as f:
for line in f:
if '# OMR ' + name in line:
if '# OMR ' + current_user.username + ' ' + name in line:
fwlist.append(line)
else:
with open('/etc/shorewall6/rules', 'r') as f:
for line in f:
if '# OMR ' + name in line:
if '# OMR ' + current_user.username + ' ' + name in line:
fwlist.append(line)
return {'list': fwlist}