From 1303b7d6a2237207b648b5b57d0c9b53e39642eb Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Sat, 18 Nov 2023 21:01:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E6=94=B9tu?= =?UTF-8?q?ic=E8=AF=BB=E5=8F=96password=E9=97=AE=E9=A2=98=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9sing-box=E5=85=A8=E5=B1=80=E5=88=86=E6=B5=81?= =?UTF-8?q?=E5=90=8E=E5=8D=B8=E8=BD=BD=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 2f8d044..a00dedf 100644 --- a/install.sh +++ b/install.sh @@ -3225,8 +3225,10 @@ addSingBoxRouteRule() { removeSingBoxRouteRule() { local outboundTag=$1 local delRules - delRules=$(jq -r 'del(.route.rules[]|select(.outbound=="'"${outboundTag}"'"))' "${singBoxConfigPath}config/${outboundTag}_route.json") - echo "${delRules}" >"${singBoxConfigPath}config/${outboundTag}_route.json" + if [[ -f "${singBoxConfigPath}config/${outboundTag}_route.json" ]]; then + delRules=$(jq -r 'del(.route.rules[]|select(.outbound=="'"${outboundTag}"'"))' "${singBoxConfigPath}config/${outboundTag}_route.json") + echo "${delRules}" >"${singBoxConfigPath}config/${outboundTag}_route.json" + fi } # 添加sing-box出站 @@ -4587,6 +4589,11 @@ EOF echoContent yellow " ---> 二维码 VLESS(VLESS+reality+uTLS+gRPC)" echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless%3A%2F%2F${id}%40$(getPublicIP)%3A${currentRealityPort}%3Fencryption%3Dnone%26security%3Dreality%26type%3Dgrpc%26sni%3D${currentRealityServerNames}%26fp%3Dchrome%26pbk%3D${currentRealityPublicKey}%26pbk%3D6ba85179e30d4fc2%26path%3Dgrpc%26serviceName%3Dgrpc%23${email}\n" elif [[ "${type}" == "tuic" ]]; then + local tuicUUID= + tuicUUID=$(echo "${id}" | awk -F "[_]" '{print $1}') + + local tuicPassword= + tuicPassword=$(echo "${id}" | awk -F "[_]" '{print $2}') if [[ -z "${email}" ]]; then echoContent red " ---> 读取配置失败,请重新安装" @@ -4594,21 +4601,21 @@ EOF fi echoContent yellow " ---> 格式化明文(Tuic+TLS)" - echoContent green " 协议类型:Tuic,地址:${currentHost},端口:${tuicPort},uuid:${id},password:${id},congestion-controller:${tuicAlgorithm},alpn: h3,账户名:${email}\n" + echoContent green " 协议类型:Tuic,地址:${currentHost},端口:${tuicPort},uuid:${tuicUUID},password:${tuicPassword},congestion-controller:${tuicAlgorithm},alpn: h3,账户名:${email}\n" cat <>"/etc/v2ray-agent/subscribe_local/default/${user}" -tuic://${id}:${id}@${currentHost}:${tuicPort}?congestion_control=${tuicAlgorithm}&alpn=h3&sni=${currentHost}&udp_relay_mode=quic&allow_insecure=0#${email} +tuic://${tuicUUID}:${tuicPassword}@${currentHost}:${tuicPort}?congestion_control=${tuicAlgorithm}&alpn=h3&sni=${currentHost}&udp_relay_mode=quic&allow_insecure=0#${email} EOF echoContent yellow " ---> v2rayN(Tuic+TLS)" - echo "{\"relay\": {\"server\": \"${currentHost}:${tuicPort}\",\"uuid\": \"${id}\",\"password\": \"${id}\",\"ip\": \"$(getPublicIP 4)\",\"congestion_control\": \"${tuicAlgorithm}\",\"alpn\": [\"h3\"]},\"local\": {\"server\": \"127.0.0.1:7798\"},\"log_level\": \"warn\"}" | jq + echo "{\"relay\": {\"server\": \"${currentHost}:${tuicPort}\",\"uuid\": \"${tuicUUID}\",\"password\": \"${tuicPassword}\",\"ip\": \"$(getPublicIP 4)\",\"congestion_control\": \"${tuicAlgorithm}\",\"alpn\": [\"h3\"]},\"local\": {\"server\": \"127.0.0.1:7798\"},\"log_level\": \"warn\"}" | jq cat <>"/etc/v2ray-agent/subscribe_local/clashMeta/${user}" - name: "${email}" server: ${currentHost} type: tuic port: ${tuicPort} - uuid: ${id} - password: ${id} + uuid: ${tuicUUID} + password: ${tuicPassword} alpn: - h3 congestion-controller: ${tuicAlgorithm} @@ -4617,7 +4624,7 @@ EOF sni: ${email} EOF echoContent yellow "\n ---> 二维码 Tuic" - echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=tuic%3A%2F%2F${id}%3A${id}%40${currentHost}%3A${tuicPort}%3Fcongestion_control%3D${tuicAlgorithm}%26alpn%3Dh3%26sni%3D${currentHost}%26udp_relay_mode%3Dquic%26allow_insecure%3D0%23${email}\n" + echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=tuic%3A%2F%2F${tuicUUID}%3A${tuicPassword}%40${currentHost}%3A${tuicPort}%3Fcongestion_control%3D${tuicAlgorithm}%26alpn%3Dh3%26sni%3D${currentHost}%26udp_relay_mode%3Dquic%26allow_insecure%3D0%23${email}\n" fi } @@ -4797,7 +4804,7 @@ showAccounts() { jq -r -c '.inbounds[]|select(.type=="tuic")|.users[]' "${singBoxConfigPath}config.json" | while read -r user; do echoContent skyBlue "\n ---> 账号:$(echo "${user}" | jq -r .name)" echo - defaultBase64Code tuic "$(echo "${user}" | jq -r .name)" "$(echo "${user}" | jq -r .uuid)" + defaultBase64Code tuic "$(echo "${user}" | jq -r .name)" "$(echo "${user}" | jq -r .uuid)_$(echo "${user}" | jq -r .password)" done fi @@ -6348,7 +6355,6 @@ EOF echoContent green " ---> WARP分流卸载成功" fi - # sing-box if [[ -n "${singBoxConfigPath}" ]]; then removeSingBoxRouteRule "wireguard_out_${type}" @@ -6457,6 +6463,7 @@ EOF elif [[ "${warpStatus}" == "4" ]]; then removeWireGuardRoute "${type}" + removeSingBoxOutbound "wireguard_out_${type}" else echoContent red " ---> 选择错误" exit 0 @@ -8477,7 +8484,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.11.15" + echoContent green "当前版本:v2.11.16" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus