|
|
@ -34,13 +34,13 @@ class firewall_api: |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self): |
|
|
|
def __init__(self): |
|
|
|
iptables_file = mw.systemdCfgDir() + '/iptables.service' |
|
|
|
iptables_file = mw.systemdCfgDir() + '/iptables.service' |
|
|
|
if os.path.exists(iptables_file): |
|
|
|
|
|
|
|
self.__isIptables = True |
|
|
|
|
|
|
|
if os.path.exists('/usr/sbin/firewalld'): |
|
|
|
if os.path.exists('/usr/sbin/firewalld'): |
|
|
|
self.__isFirewalld = True |
|
|
|
self.__isFirewalld = True |
|
|
|
if os.path.exists('/usr/sbin/ufw'): |
|
|
|
elif os.path.exists(iptables_file): |
|
|
|
|
|
|
|
self.__isIptables = True |
|
|
|
|
|
|
|
elif os.path.exists('/usr/sbin/ufw'): |
|
|
|
self.__isUfw = True |
|
|
|
self.__isUfw = True |
|
|
|
if mw.isAppleSystem(): |
|
|
|
elif mw.isAppleSystem(): |
|
|
|
self.__isMac = True |
|
|
|
self.__isMac = True |
|
|
|
|
|
|
|
|
|
|
|
##### ----- start ----- ### |
|
|
|
##### ----- start ----- ### |
|
|
|