From f82d13af70d3be8eaf94ec6b7f1f0418e257f29f Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Fri, 24 Mar 2023 21:12:16 +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=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9reality=E8=8E=B7=E5=8F=96IPv6?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 9ed82f5..e63ae0c 100644 --- a/install.sh +++ b/install.sh @@ -421,7 +421,12 @@ allowPort() { } # 获取公网IP getPublicIP() { - curl -s http://www.cloudflare.com/cdn-cgi/trace | grep "ip" | awk -F "[=]" '{print $2}' + local currentIP= + currentIP=$(curl -s -4 http://www.cloudflare.com/cdn-cgi/trace | grep "ip" | awk -F "[=]" '{print $2}') + if [[ -z "${currentIP}" ]]; then + currentIP=$(curl -s -6 http://www.cloudflare.com/cdn-cgi/trace | grep "ip" | awk -F "[=]" '{print $2}') + fi + echo "${currentIP}" } # 检查80、443端口占用情况 checkPortUsedStatus() { @@ -521,15 +526,6 @@ readConfigHostPathUUID() { fi fi - local defaultPortFile= - defaultPortFile=$(find ${configPath}* | grep "default") - - if [[ -n "${defaultPortFile}" ]]; then - currentDefaultPort=$(echo "${defaultPortFile}" | awk -F [_] '{print $4}') - else - currentDefaultPort=$(jq -r .inbounds[0].port ${configPath}${frontingType}.json) - fi - fi if [[ -n "${configPath}" ]]; then @@ -537,6 +533,14 @@ readConfigHostPathUUID() { currentUUID=$(jq -r .inbounds[0].settings.clients[0].id ${configPath}${frontingType}.json) currentClients=$(jq -r .inbounds[0].settings.clients ${configPath}${frontingType}.json) else + local defaultPortFile= + defaultPortFile=$(find ${configPath}* | grep "default") + + if [[ -n "${defaultPortFile}" ]]; then + currentDefaultPort=$(echo "${defaultPortFile}" | awk -F [_] '{print $4}') + else + currentDefaultPort=$(jq -r .inbounds[0].port ${configPath}${frontingType}.json) + fi 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 @@ -5930,7 +5934,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.7.19_reality_beta" + echoContent green "当前版本:v2.7.20_reality_beta" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus