From ad3d93cf8bb48f6239929a72429e0316b377f69a Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 12 Feb 2023 02:03:57 +0800 Subject: [PATCH] =?UTF-8?q?firewalld=E9=98=B2=E7=81=AB=E5=A2=99=E4=BC=98?= =?UTF-8?q?=E5=85=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/firewall_api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/class/core/firewall_api.py b/class/core/firewall_api.py index ec650207e..180d2791e 100755 --- a/class/core/firewall_api.py +++ b/class/core/firewall_api.py @@ -34,13 +34,13 @@ class firewall_api: def __init__(self): 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 - 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 - if mw.isAppleSystem(): + elif mw.isAppleSystem(): self.__isMac = True ##### ----- start ----- ###