mirror of https://github.com/mack-a/v2ray-agent
fix(脚本): 修改防火墙检测问题
parent
52f5172c64
commit
ba5de2c976
30
install.sh
30
install.sh
|
@ -83,12 +83,12 @@ checkCPUVendor() {
|
||||||
'amd64' | 'x86_64')
|
'amd64' | 'x86_64')
|
||||||
xrayCoreCPUVendor="Xray-linux-64"
|
xrayCoreCPUVendor="Xray-linux-64"
|
||||||
v2rayCoreCPUVendor="v2ray-linux-64"
|
v2rayCoreCPUVendor="v2ray-linux-64"
|
||||||
hysteriaCoreCPUVendor="hysteria-linux-amd64"
|
# hysteriaCoreCPUVendor="hysteria-linux-amd64"
|
||||||
;;
|
;;
|
||||||
'armv8' | 'aarch64')
|
'armv8' | 'aarch64')
|
||||||
xrayCoreCPUVendor="Xray-linux-arm64-v8a"
|
xrayCoreCPUVendor="Xray-linux-arm64-v8a"
|
||||||
v2rayCoreCPUVendor="v2ray-linux-arm64-v8a"
|
v2rayCoreCPUVendor="v2ray-linux-arm64-v8a"
|
||||||
hysteriaCoreCPUVendor="hysteria-linux-arm64"
|
# hysteriaCoreCPUVendor="hysteria-linux-arm64"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo " 不支持此CPU架构--->"
|
echo " 不支持此CPU架构--->"
|
||||||
|
@ -113,7 +113,7 @@ initVar() {
|
||||||
# 核心支持的cpu版本
|
# 核心支持的cpu版本
|
||||||
xrayCoreCPUVendor=""
|
xrayCoreCPUVendor=""
|
||||||
v2rayCoreCPUVendor=""
|
v2rayCoreCPUVendor=""
|
||||||
hysteriaCoreCPUVendor=""
|
# hysteriaCoreCPUVendor=""
|
||||||
|
|
||||||
# 域名
|
# 域名
|
||||||
domain=
|
domain=
|
||||||
|
@ -287,24 +287,20 @@ allowPort() {
|
||||||
iptables -I INPUT -p tcp --dport "$1" -m comment --comment "allow $1(mack-a)" -j ACCEPT
|
iptables -I INPUT -p tcp --dport "$1" -m comment --comment "allow $1(mack-a)" -j ACCEPT
|
||||||
fi
|
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
|
if echo "${updateFirewalldStatus}" | grep -q "true"; then
|
||||||
netfilter-persistent save
|
netfilter-persistent save
|
||||||
fi
|
fi
|
||||||
elif systemctl status ufw 2>/dev/null | grep -q "active (exited)"; then
|
elif systemctl status ufw 2>/dev/null | grep -q "active (exited)"; then
|
||||||
|
if ufw status | grep -q "Status: active"; then
|
||||||
if ! ufw status | grep -q "$1"; then
|
if ! ufw status | grep -q "$1"; then
|
||||||
sudo ufw allow "$1"
|
sudo ufw allow "$1"
|
||||||
checkUFWAllowPort "$1"
|
checkUFWAllowPort "$1"
|
||||||
fi
|
fi
|
||||||
# if ! ufw status | grep -q $1; then
|
fi
|
||||||
# sudo ufw allow $1
|
|
||||||
# checkUFWAllowPort $1
|
elif
|
||||||
# fi
|
systemctl status firewalld 2>/dev/null | grep -q "active (running)"
|
||||||
elif systemctl status firewalld 2>/dev/null | grep -q "active (running)"; then
|
then
|
||||||
local updateFirewalldStatus=
|
local updateFirewalldStatus=
|
||||||
if ! firewall-cmd --list-ports --permanent | grep -qw "$1/tcp"; then
|
if ! firewall-cmd --list-ports --permanent | grep -qw "$1/tcp"; then
|
||||||
updateFirewalldStatus=true
|
updateFirewalldStatus=true
|
||||||
|
@ -312,12 +308,6 @@ allowPort() {
|
||||||
checkFirewalldAllowPort "$1"
|
checkFirewalldAllowPort "$1"
|
||||||
fi
|
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
|
if echo "${updateFirewalldStatus}" | grep -q "true"; then
|
||||||
firewall-cmd --reload
|
firewall-cmd --reload
|
||||||
fi
|
fi
|
||||||
|
@ -4566,7 +4556,7 @@ menu() {
|
||||||
cd "$HOME" || exit
|
cd "$HOME" || exit
|
||||||
echoContent red "\n=============================================================="
|
echoContent red "\n=============================================================="
|
||||||
echoContent green "作者:mack-a"
|
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 "Github:https://github.com/mack-a/v2ray-agent"
|
||||||
echoContent green "描述:八合一共存脚本\c"
|
echoContent green "描述:八合一共存脚本\c"
|
||||||
showInstallStatus
|
showInstallStatus
|
||||||
|
|
Loading…
Reference in New Issue