From ba5de2c9761172d23a4f658de3e856533dc44f99 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Fri, 29 Apr 2022 15:31:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=98=B2=E7=81=AB=E5=A2=99=E6=A3=80=E6=B5=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/install.sh b/install.sh index 1ddaa10..65cd50c 100644 --- a/install.sh +++ b/install.sh @@ -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