From ee00c667a3b1e8a03d95abfa8a2873927f660054 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:34:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=96=B9=E5=BC=8F2->1->7=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=90=88=E5=B9=B6=E8=AE=A2=E9=98=85=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BB=A5=E5=8F=8A=E6=97=A0=E6=B3=95=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index df4d5aa..fbbd54b 100644 --- a/install.sh +++ b/install.sh @@ -2852,7 +2852,8 @@ handleSingBox() { echoContent green " ---> sing-box启动成功" else echoContent red "sing-box启动失败" - echoContent red "请手动执行【/etc/v2ray-agent/sing-box/sing-box run -c /etc/v2ray-agent/sing-box/conf/config.json】,查看错误日志" + echoContent red "请手动执行【/etc/v2ray-agent/sing-box/sing-box merge config.json -C /etc/v2ray-agent/sing-box/conf/config/ -D /etc/v2ray-agent/sing-box/conf/】,查看错误日志" + echoContent red "如上面命令没有错误,请手动执行【/etc/v2ray-agent/sing-box/sing-box run -c /etc/v2ray-agent/sing-box/conf/config.json】,查看错误日志" exit 0 fi elif [[ "$1" == "stop" ]]; then @@ -5886,8 +5887,15 @@ customUserEmail() { else local checkEmail= if [[ "${coreInstallType}" == "1" ]]; then - checkEmail=$(jq -r --arg currentEmail "$currentCustomEmail" ".inbounds[0].settings.clients[] | select(.name | index(\$currentEmail) != null) | .name" ${configPath}${frontingType}.json) - elif [[ "${coreInstallType}" == "2" ]]; then + local frontingTypeConfig="${frontingType}" + if [[ "${currentInstallProtocolType}" == ",7,8," ]]; then + frontingTypeConfig="07_VLESS_vision_reality_inbounds" + fi + + checkEmail=$(jq -r --arg currentEmail "$currentCustomEmail" ".inbounds[0].settings.clients[] | select(.name | index(\$currentEmail) != null) | .name" ${configPath}${frontingTypeConfig}.json) + elif + [[ "${coreInstallType}" == "2" ]] + then checkEmail=$(jq -r --arg currentEmail "$currentCustomEmail" ".inbounds[0].users[] | select(.name | index(\$currentEmail) != null) | .name" ${configPath}${frontingType}.json) fi @@ -5973,7 +5981,6 @@ addUser() { clients=$(jq -r "${userConfig} = ${clients}" ${configPath}05_VMess_WS_inbounds.json) echo "${clients}" | jq . >${configPath}05_VMess_WS_inbounds.json fi - # trojan tcp if echo "${currentInstallProtocolType}" | grep -q ",4,"; then local clients= @@ -8419,7 +8426,11 @@ addOtherSubscribe() { echoContent red " ---> 此订阅已添加" exit 0 fi - + echo + read -r -p "是否是HTTP订阅?[y/n]" httpSubscribeStatus + if [[ "${httpSubscribeStatus}" == "y" ]]; then + remoteSubscribeUrl="${remoteSubscribeUrl}:http" + fi echo "${remoteSubscribeUrl}" >>/etc/v2ray-agent/subscribe_remote/remoteSubscribeUrl subscribe fi @@ -8943,14 +8954,24 @@ updateRemoteSubscribe() { local emailMD5=$1 local email=$2 while read -r line; do + local subscribeType= + subscribeType="https" + local serverAlias= serverAlias=$(echo "${line}" | awk -F "[:]" '{print $3}') local remoteUrl= remoteUrl=$(echo "${line}" | awk -F "[:]" '{print $1":"$2}') + local subscribeTypeRemote= + subscribeTypeRemote=$(echo "${line}" | awk -F "[:]" '{print $4}') + + if [[ -n "${subscribeTypeRemote}" ]]; then + subscribeType="${subscribeTypeRemote}" + fi local clashMetaProxies= - clashMetaProxies=$(curl -s -4 "https://${remoteUrl}/s/clashMeta/${emailMD5}" | sed '/proxies:/d' | sed "s/\"${email}/\"${email}_${serverAlias}/g") + + clashMetaProxies=$(curl -s -4 "${subscribeType}://${remoteUrl}/s/clashMeta/${emailMD5}" | sed '/proxies:/d' | sed "s/\"${email}/\"${email}_${serverAlias}/g") if ! echo "${clashMetaProxies}" | grep -q "nginx" && [[ -n "${clashMetaProxies}" ]]; then echo "${clashMetaProxies}" >>"/etc/v2ray-agent/subscribe/clashMeta/${emailMD5}" @@ -8960,7 +8981,7 @@ updateRemoteSubscribe() { fi local default= - default=$(curl -s -4 "https://${remoteUrl}/s/default/${emailMD5}") + default=$(curl -s -4 "${subscribeType}://${remoteUrl}/s/default/${emailMD5}") if ! echo "${default}" | grep -q "nginx" && [[ -n "${default}" ]]; then default=$(echo "${default}" | base64 -d | sed "s/#${email}/#${email}_${serverAlias}/g") @@ -8972,7 +8993,7 @@ updateRemoteSubscribe() { fi local singBoxSubscribe= - singBoxSubscribe=$(curl -s -4 "https://${remoteUrl}/s/sing-box_profiles/${emailMD5}") + singBoxSubscribe=$(curl -s -4 "${subscribeType}://${remoteUrl}/s/sing-box_profiles/${emailMD5}") if ! echo "${singBoxSubscribe}" | grep -q "nginx" && [[ -n "${singBoxSubscribe}" ]]; then singBoxSubscribe=${singBoxSubscribe//tag\": \"${email}/tag\": \"${email}_${serverAlias}} @@ -9448,7 +9469,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v3.3.12" + echoContent green "当前版本:v3.3.13" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus