mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update firewall_api.py
This commit is contained in:
@@ -471,7 +471,13 @@ class firewall_api:
|
||||
if data[0].strip() == 'inactive':
|
||||
return False
|
||||
return True
|
||||
if self.__isFirewalld:
|
||||
elif self.__isIptables:
|
||||
cmd = "systemctl status iptables | grep 'inactive'"
|
||||
data = mw.execShell(cmd)
|
||||
if data[0] != '':
|
||||
return False
|
||||
return True
|
||||
elif self.__isFirewalld:
|
||||
cmd = "ps -ef|grep firewalld |grep -v grep | awk '{print $2}'"
|
||||
data = mw.execShell(cmd)
|
||||
if data[0] == '':
|
||||
@@ -480,8 +486,4 @@ class firewall_api:
|
||||
elif self.__isMac:
|
||||
return False
|
||||
else:
|
||||
cmd = "systemctl status iptables | grep 'inactive'"
|
||||
data = mw.execShell(cmd)
|
||||
if data[0] != '':
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user