From bcdfb8960176141f8b08c5a9e199249c65d5bc58 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Wed, 20 Mar 2024 17:35:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=88=86=E6=B5=81=E6=9F=A5=E7=9C=8B=E5=9F=9F=E5=90=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/install.sh b/install.sh index 781509a..202a165 100644 --- a/install.sh +++ b/install.sh @@ -5874,15 +5874,16 @@ ipv6Routing() { fi fi - - if [[ -f "${singBoxConfigPath}IPv6_out_route.json" ]]; then - echoContent yellow "sing-box" - jq -r -c '.route.rules[]|select (.outbound=="IPv6_out")' "${singBoxConfigPath}IPv6_out_route.json" | jq -r - elif [[ ! -f "${singBoxConfigPath}IPv6_out_route.json" && -f "${singBoxConfigPath}IPv6_out.json" ]]; then - echoContent yellow "sing-box" - echoContent green " ---> 已设置IPv6全局分流" - else - echoContent yellow " ---> 未安装IPv6分流" + if [[ -n "${singBoxConfigPath}" ]]; then + if [[ -f "${singBoxConfigPath}IPv6_out_route.json" ]]; then + echoContent yellow "sing-box" + jq -r -c '.route.rules[]|select (.outbound=="IPv6_out")' "${singBoxConfigPath}IPv6_out_route.json" | jq -r + elif [[ ! -f "${singBoxConfigPath}IPv6_out_route.json" && -f "${singBoxConfigPath}IPv6_out.json" ]]; then + echoContent yellow "sing-box" + echoContent green " ---> 已设置IPv6全局分流" + else + echoContent yellow " ---> 未安装IPv6分流" + fi fi exit 0 @@ -6287,15 +6288,18 @@ showWireGuardDomain() { fi # sing-box - if [[ -f "${singBoxConfigPath}wireguard_out_${type}_route.json" ]]; then - echoContent yellow "sing-box" - jq -r -c '.route.rules[]' "${singBoxConfigPath}wireguard_out_${type}_route.json" | jq -r - elif [[ ! -f "${singBoxConfigPath}wireguard_out_${type}_route.json" && -f "${singBoxConfigPath}wireguard_out_${type}.json" ]]; then - echoContent yellow "sing-box" - echoContent green " ---> 已设置warp ${type}全局分流" - else - echoContent yellow " ---> 未安装warp ${type}分流" + if [[ -n "${singBoxConfigPath}" ]]; then + if [[ -f "${singBoxConfigPath}wireguard_out_${type}_route.json" ]]; then + echoContent yellow "sing-box" + jq -r -c '.route.rules[]' "${singBoxConfigPath}wireguard_out_${type}_route.json" | jq -r + elif [[ ! -f "${singBoxConfigPath}wireguard_out_${type}_route.json" && -f "${singBoxConfigPath}wireguard_out_${type}.json" ]]; then + echoContent yellow "sing-box" + echoContent green " ---> 已设置warp ${type}全局分流" + else + echoContent yellow " ---> 未安装warp ${type}分流" + fi fi + } # 添加WireGuard分流 @@ -8773,7 +8777,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v3.2.31" + echoContent green "当前版本:v3.2.32" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus