From fdf730253d9baaba3ea2e0bfee6fc7dafc964e7a Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Thu, 3 Jun 2021 17:00:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E3=80=81=E6=B7=BB=E5=8A=A0gRPC=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index c5ccbb5..fb4c4c2 100644 --- a/install.sh +++ b/install.sh @@ -249,19 +249,19 @@ readConfigHostPathUUID() { currentAdd= # 读取path if [[ -n "${configPath}" ]]; then - local path + local fallback=$(jq -r -c '.inbounds[0].settings.fallbacks[]|select(.path)' ${configPath}02_VLESS_TCP_inbounds.json|head -1) - path=$(jq -r -c '.inbounds[0].settings.fallbacks[]|select(.path).path' ${configPath}02_VLESS_TCP_inbounds.json | awk -F "[/]" '{print $2}' | awk -F "[\"]" '{print $1}' | tail -n +2 | head -n 1) - if [[ -n "${path}" ]]; then - if [[ "${path:0-3}" == "vws" && ${#path} -gt 6 ]]; then - currentPath=$(echo "${path}" | awk -F "[v][w][s]" '{print $1}') - elif [[ "${path:0-2}" == "ws" ]]; then - currentPath=$(echo "${path}" | awk -F "[w][s]" '{print $1}') - elif [[ "${path:0-2}" == "tcp" ]]; then - currentPath=$(echo "${path}" | awk -F "[t][c][p]" '{print $1}') - fi + local path=$(echo "${fallback}"|jq -r .path|awk -F "[/]" '{print $2}') + + if [[ $(echo "${fallback}"|jq -r .dest) == 31297 ]]; then + currentPath=$(echo "${path}" | awk -F "[w][s]" '{print $1}') + elif [[ $(echo "${fallback}"|jq -r .dest) == 31298 ]]; then + currentPath=$(echo "${path}" | awk -F "[t][c][p]" '{print $1}') + elif [[ $(echo "${fallback}"|jq -r .dest) == 31299 ]]; then + currentPath=$(echo "${path}" | awk -F "[v][w][s]" '{print $1}') fi fi + if [[ "${coreInstallType}" == "1" ]]; then currentHost=$(jq -r .inbounds[0].streamSettings.xtlsSettings.certificates[0].certificateFile ${configPath}02_VLESS_TCP_inbounds.json | awk -F '[t][l][s][/]' '{print $2}' | awk -F '[.][c][r][t]' '{print $1}') currentUUID=$(jq -r .inbounds[0].settings.clients[0].id ${configPath}02_VLESS_TCP_inbounds.json) @@ -2255,6 +2255,9 @@ EOF local VLESSEmail VLESSEmail=$(echo "${ps}" | awk -F "[\"]" '{print $2}') + echoContent yellow " ---> 通用格式(VLESS+gRPC+TLS)" + echoContent green " vless://${VLESSID}@${add}:${port}?encryption=none&security=tls&type=grpc&host=${host}&path=${path}#${VLESSEmail}\n" + echoContent yellow " ---> 格式化明文(VLESS+gRPC+TLS)" echoContent green " 协议类型:VLESS,地址:${add},伪装域名/SNI:${host},端口:${port},用户ID:${VLESSID},安全:tls,传输方式:gRPC,serviceName:${path},账户名:${VLESSEmail}\n" @@ -3751,7 +3754,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.4.35" + echoContent green "当前版本:v2.4.36" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus