fix(脚本): 修改防火墙检测问题

pull/534/merge
mack-a 2022-04-29 15:31:43 +08:00
parent 52f5172c64
commit ba5de2c976
1 changed files with 13 additions and 23 deletions

View File

@ -83,12 +83,12 @@ checkCPUVendor() {
'amd64' | 'x86_64')
xrayCoreCPUVendor="Xray-linux-64"
v2rayCoreCPUVendor="v2ray-linux-64"
hysteriaCoreCPUVendor="hysteria-linux-amd64"
# hysteriaCoreCPUVendor="hysteria-linux-amd64"
;;
'armv8' | 'aarch64')
xrayCoreCPUVendor="Xray-linux-arm64-v8a"
v2rayCoreCPUVendor="v2ray-linux-arm64-v8a"
hysteriaCoreCPUVendor="hysteria-linux-arm64"
# hysteriaCoreCPUVendor="hysteria-linux-arm64"
;;
*)
echo " 不支持此CPU架构--->"
@ -113,7 +113,7 @@ initVar() {
# 核心支持的cpu版本
xrayCoreCPUVendor=""
v2rayCoreCPUVendor=""
hysteriaCoreCPUVendor=""
# hysteriaCoreCPUVendor=""
# 域名
domain=
@ -287,24 +287,20 @@ allowPort() {
iptables -I INPUT -p tcp --dport "$1" -m comment --comment "allow $1(mack-a)" -j ACCEPT
fi
# if ! iptables -L | grep -q "$1(mack-a)"; then
# updateFirewalldStatus=true
# iptables -I INPUT -p tcp --dport $1 -m comment --comment "allow $1(mack-a)" -j ACCEPT
# fi
if echo "${updateFirewalldStatus}" | grep -q "true"; then
netfilter-persistent save
fi
elif systemctl status ufw 2>/dev/null | grep -q "active (exited)"; then
if ! ufw status | grep -q "$1"; then
sudo ufw allow "$1"
checkUFWAllowPort "$1"
if ufw status | grep -q "Status: active"; then
if ! ufw status | grep -q "$1"; then
sudo ufw allow "$1"
checkUFWAllowPort "$1"
fi
fi
# if ! ufw status | grep -q $1; then
# sudo ufw allow $1
# checkUFWAllowPort $1
# fi
elif systemctl status firewalld 2>/dev/null | grep -q "active (running)"; then
elif
systemctl status firewalld 2>/dev/null | grep -q "active (running)"
then
local updateFirewalldStatus=
if ! firewall-cmd --list-ports --permanent | grep -qw "$1/tcp"; then
updateFirewalldStatus=true
@ -312,12 +308,6 @@ allowPort() {
checkFirewalldAllowPort "$1"
fi
# if ! firewall-cmd --list-ports --permanent | grep -qw "$1/tcp"; then
# updateFirewalldStatus=true
# firewall-cmd --zone=public --add-port=$1/tcp --permanent
# checkFirewalldAllowPort $1
# fi
if echo "${updateFirewalldStatus}" | grep -q "true"; then
firewall-cmd --reload
fi
@ -4566,7 +4556,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者:mack-a"
echoContent green "当前版本:v2.5.63"
echoContent green "当前版本:v2.5.64"
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus