Fix iptables detection

pull/291/head
hiCasper 2 years ago
parent b3c8a6365f
commit cab35c7c28
  1. 12
      class/core/firewall_api.py
  2. 4
      scripts/install/alma.sh
  3. 4
      scripts/install/amazon.sh
  4. 4
      scripts/install/arch.sh
  5. 4
      scripts/install/centos.sh
  6. 4
      scripts/install/fedora.sh
  7. 4
      scripts/install/freebsd.sh
  8. 4
      scripts/install/opensuse.sh
  9. 4
      scripts/install/rocky.sh

@ -352,8 +352,8 @@ class firewall_api:
elif self.__isMac:
pass
else:
mw.execShell('/etc/init.d/iptables save')
mw.execShell('/etc/init.d/iptables stop')
mw.execShell('service iptables save')
mw.execShell('service iptables stop')
else:
if self.__isUfw:
mw.execShell("echo 'y'| ufw enable")
@ -363,8 +363,8 @@ class firewall_api:
elif self.__isMac:
pass
else:
mw.execShell('/etc/init.d/iptables save')
mw.execShell('/etc/init.d/iptables restart')
mw.execShell('service iptables save')
mw.execShell('service iptables restart')
return mw.returnData(True, '设置成功!')
@ -437,8 +437,8 @@ class firewall_api:
elif self.__isMac:
pass
else:
mw.execShell('/etc/init.d/iptables save')
mw.execShell('/etc/init.d/iptables restart')
mw.execShell('service iptables save')
mw.execShell('service iptables restart')
def getFwStatus(self):
if self.__isUfw:

@ -20,7 +20,7 @@ if [ ! -d /root/.acme.sh ];then
curl https://get.acme.sh | sh
fi
if [ -f /etc/init.d/iptables ];then
if [ -f /usr/sbin/iptables ];then
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
@ -41,7 +41,7 @@ if [ -f /etc/init.d/iptables ];then
fi
if [ ! -f /etc/init.d/iptables ];then
if [ ! -f /usr/sbin/iptables ];then
yum install firewalld -y
systemctl enable firewalld
systemctl start firewalld

@ -28,7 +28,7 @@ if [ ! -d /root/.acme.sh ];then
curl https://get.acme.sh | sh
fi
if [ -f /etc/init.d/iptables ];then
if [ -f /usr/sbin/iptables ];then
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
@ -49,7 +49,7 @@ if [ -f /etc/init.d/iptables ];then
fi
if [ ! -f /etc/init.d/iptables ];then
if [ ! -f /usr/sbin/iptables ];then
yum install firewalld -y
systemctl enable firewalld
#取消服务锁定

@ -59,7 +59,7 @@ if [ ! -d /root/.acme.sh ];then
curl https://get.acme.sh | sh
fi
if [ -f /etc/init.d/iptables ];then
if [ -f /usr/sbin/iptables ];then
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
@ -80,7 +80,7 @@ if [ -f /etc/init.d/iptables ];then
fi
if [ ! -f /etc/init.d/iptables ];then
if [ ! -f /usr/sbin/iptables ];then
echo y | pacman -Sy firewalld
systemctl enable firewalld
systemctl start firewalld

@ -29,7 +29,7 @@ if [ ! -d /root/.acme.sh ];then
curl https://get.acme.sh | sh
fi
if [ -f /etc/init.d/iptables ];then
if [ -f /usr/sbin/iptables ];then
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
@ -50,7 +50,7 @@ if [ -f /etc/init.d/iptables ];then
fi
if [ ! -f /etc/init.d/iptables ];then
if [ ! -f /usr/sbin/iptables ];then
yum install firewalld -y
systemctl enable firewalld
#取消服务锁定

@ -23,7 +23,7 @@ if [ ! -d /root/.acme.sh ];then
curl https://get.acme.sh | sh
fi
if [ -f /etc/init.d/iptables ];then
if [ -f /usr/sbin/iptables ];then
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
@ -46,7 +46,7 @@ fi
if [ "${isVersion}" == '' ];then
if [ ! -f "/etc/init.d/iptables" ];then
if [ ! -f "/usr/sbin/iptables" ];then
yum install firewalld -y
systemctl enable firewalld
systemctl start firewalld

@ -45,7 +45,7 @@ if [ ! -d /root/.acme.sh ];then
curl https://get.acme.sh | sh
fi
if [ -f /etc/init.d/iptables ];then
if [ -f /usr/sbin/iptables ];then
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
@ -66,7 +66,7 @@ if [ -f /etc/init.d/iptables ];then
fi
if [ ! -f /etc/init.d/iptables ];then
if [ ! -f /usr/sbin/iptables ];then
pkg install -y firewalld
systemctl enable firewalld
systemctl start firewalld

@ -56,7 +56,7 @@ if [ ! -d /root/.acme.sh ];then
curl https://get.acme.sh | sh
fi
if [ -f /etc/init.d/iptables ];then
if [ -f /usr/sbin/iptables ];then
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
@ -77,7 +77,7 @@ if [ -f /etc/init.d/iptables ];then
fi
if [ ! -f /etc/init.d/iptables ];then
if [ ! -f /usr/sbin/iptables ];then
zypper install -y firewalld
systemctl enable firewalld
systemctl start firewalld

@ -24,7 +24,7 @@ if [ ! -d /root/.acme.sh ];then
curl https://get.acme.sh | sh
fi
if [ -f /etc/init.d/iptables ];then
if [ -f /usr/sbin/iptables ];then
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
@ -45,7 +45,7 @@ if [ -f /etc/init.d/iptables ];then
fi
if [ ! -f /etc/init.d/iptables ];then
if [ ! -f /usr/sbin/iptables ];then
yum install firewalld -y
systemctl enable firewalld
systemctl start firewalld

Loading…
Cancel
Save