Update firewall.py

This commit is contained in:
dami
2025-05-27 11:04:38 +08:00
parent 52a305f5cd
commit 62b3d15991
+5 -4
View File
@@ -70,6 +70,8 @@ class Firewall(object):
continue
info = pinfo.split('/')
if len(info) != 2:
continue
is_same = False
for i in range(len(ports_all)):
@@ -79,10 +81,9 @@ class Firewall(object):
if not is_same:
t = {}
if len(info) == 2:
t['port'] = info[0].replace('-',':')
t['protocol'] = info[1]
ports_all.append(t)
t['port'] = info[0].replace('-',':')
t['protocol'] = info[1]
ports_all.append(t)
for add_info in ports_all:
if thisdb.getFirewallCountByPort(add_info['port']) == 0:
thisdb.addFirewall(add_info['port'], ps='自动识别',protocol=add_info['protocol'])