From 1f043dd17908ae2c6be31872fa25043f1c496d2b Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Fri, 24 Mar 2023 22:23:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E4=B8=8D=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index e63ae0c..1157d41 100644 --- a/install.sh +++ b/install.sh @@ -528,11 +528,17 @@ readConfigHostPathUUID() { fi - if [[ -n "${configPath}" ]]; then - if [[ -z "${realityStatus}" ]]; then - currentUUID=$(jq -r .inbounds[0].settings.clients[0].id ${configPath}${frontingType}.json) - currentClients=$(jq -r .inbounds[0].settings.clients ${configPath}${frontingType}.json) - else + if [[ "${coreInstallType}" == "1" ]]; then + + # 安装 + if [[ -n "${frontingType}" ]]; then + currentHost=$(jq -r .inbounds[0].streamSettings.tlsSettings.certificates[0].certificateFile ${configPath}${frontingType}.json | awk -F '[t][l][s][/]' '{print $2}' | awk -F '[.][c][r][t]' '{print $1}') + currentAdd=$(jq -r .inbounds[0].settings.clients[0].add ${configPath}${frontingType}.json) + if [[ "${currentAdd}" == "null" ]]; then + currentAdd=${currentHost} + fi + currentPort=$(jq .inbounds[0].port ${configPath}${frontingType}.json) + local defaultPortFile= defaultPortFile=$(find ${configPath}* | grep "default") @@ -541,18 +547,16 @@ readConfigHostPathUUID() { else currentDefaultPort=$(jq -r .inbounds[0].port ${configPath}${frontingType}.json) fi + currentUUID=$(jq -r .inbounds[0].settings.clients[0].id ${configPath}${frontingType}.json) + currentClients=$(jq -r .inbounds[0].settings.clients ${configPath}${frontingType}.json) + fi + + # reality + if [[ -n "${realityStatus}" && -z "${currentClients}" ]]; then currentUUID=$(jq -r .inbounds[0].settings.clients[0].id ${configPath}07_VLESS_vision_reality_inbounds.json) currentClients=$(jq -r .inbounds[0].settings.clients ${configPath}07_VLESS_vision_reality_inbounds.json) - fi - fi - if [[ "${coreInstallType}" == "1" && -n "${frontingType}" ]]; then - currentHost=$(jq -r .inbounds[0].streamSettings.tlsSettings.certificates[0].certificateFile ${configPath}${frontingType}.json | awk -F '[t][l][s][/]' '{print $2}' | awk -F '[.][c][r][t]' '{print $1}') - currentAdd=$(jq -r .inbounds[0].settings.clients[0].add ${configPath}${frontingType}.json) - if [[ "${currentAdd}" == "null" ]]; then - currentAdd=${currentHost} fi - currentPort=$(jq .inbounds[0].port ${configPath}${frontingType}.json) elif [[ "${coreInstallType}" == "2" ]]; then currentHost=$(jq -r .inbounds[0].streamSettings.tlsSettings.certificates[0].certificateFile ${configPath}${frontingType}.json | awk -F '[t][l][s][/]' '{print $2}' | awk -F '[.][c][r][t]' '{print $1}') currentAdd=$(jq -r .inbounds[0].settings.clients[0].add ${configPath}${frontingType}.json) @@ -5934,7 +5938,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.7.20_reality_beta" + echoContent green "当前版本:v2.7.21_reality_beta" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus