优化iptables判断

This commit is contained in:
midoks
2023-01-18 17:27:33 +08:00
parent 19e6055b7c
commit 42ba0ea285
3 changed files with 12 additions and 6 deletions
+2 -1
View File
@@ -33,7 +33,8 @@ class firewall_api:
__isMac = False
def __init__(self):
if os.path.exists('/usr/sbin/iptables'):
iptables_file = mw.systemdCfgDir() + '/iptables.service'
if os.path.exists(iptables_file):
self.__isIptables = True
if os.path.exists('/usr/sbin/firewalld'):
self.__isFirewalld = True