fix(脚本): 修改添加用户后删除原用户导致的分享链接为null问题

pull/534/merge
mack-a 2021-06-04 17:28:57 +08:00
parent fdf730253d
commit 92989cd539
1 changed files with 9 additions and 1 deletions

View File

@ -266,6 +266,9 @@ readConfigHostPathUUID() {
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)
currentAdd=$(jq -r .inbounds[0].settings.clients[0].add ${configPath}02_VLESS_TCP_inbounds.json)
if [[ "${currentAdd}" == "null" ]];then
currentAdd=${currentHost}
fi
currentPort=$(jq .inbounds[0].port ${configPath}02_VLESS_TCP_inbounds.json)
elif [[ "${coreInstallType}" == "2" || "${coreInstallType}" == "3" ]]; then
@ -275,6 +278,10 @@ readConfigHostPathUUID() {
currentHost=$(jq -r .inbounds[0].streamSettings.tlsSettings.certificates[0].certificateFile ${configPath}02_VLESS_TCP_inbounds.json | awk -F '[t][l][s][/]' '{print $2}' | awk -F '[.][c][r][t]' '{print $1}')
fi
currentAdd=$(jq -r .inbounds[0].settings.clients[0].add ${configPath}02_VLESS_TCP_inbounds.json)
if [[ "${currentAdd}" == "null" ]];then
currentAdd=${currentHost}
fi
currentUUID=$(jq -r .inbounds[0].settings.clients[0].id ${configPath}02_VLESS_TCP_inbounds.json)
currentPort=$(jq .inbounds[0].port ${configPath}02_VLESS_TCP_inbounds.json)
fi
@ -2256,7 +2263,7 @@ EOF
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 green " vless://${VLESSID}@${add}:${port}?encryption=none&security=tls&type=grpc&host=${host}&serviceName=${path}#${VLESSEmail}\n"
echoContent yellow " ---> 格式化明文(VLESS+gRPC+TLS)"
echoContent green " 协议类型VLESS地址${add},伪装域名/SNI${host},端口:${port}用户ID${VLESSID}安全tls传输方式gRPCserviceName:${path},账户名:${VLESSEmail}\n"
@ -2362,6 +2369,7 @@ showAccounts() {
defaultBase64Code vmessws $(echo "${user}" | jq .email) $(echo "${user}" | jq .id) "${currentHost}:${currentPort}" ${path} ${currentAdd}
done
fi
# VLESS grpc
if echo ${currentInstallProtocolType} | grep -q 5 || [[ -z "${currentInstallProtocolType}" ]]; then
echoContent skyBlue "\n=============================== VLESS gRPC TLS CDN ===============================\n"