From fa8fa3d6404747bff178bc001d8f9b163412c8fe Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Wed, 14 Oct 2020 14:08:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=87=8D=E7=BD=AEuuid=E6=97=B6=E4=B8=8D=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E4=B8=AA=E6=80=A7=E5=8C=96=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 818010a..092e532 100644 --- a/install.sh +++ b/install.sh @@ -1844,7 +1844,7 @@ updateV2RayCDN(){ resetUUID(){ echoContent skyBlue "\n进度 $1/${totalProgress} : 重置UUID" local resetStatus=false - if [[ -d "/etc/v2ray-agent" ]] && [[ -d "/etc/v2ray-agent/v2ray" ]] && [[ -f "/etc/v2ray-agent/v2ray/config.json" ]] + if [[ -d "/etc/v2ray-agent" ]] && [[ -d "/etc/v2ray-agent/v2ray" ]] && [[ -f "/etc/v2ray-agent/v2ray/config.json" ]] && [[ -z "${customInstallType}" ]] then cat /etc/v2ray-agent/v2ray/config.json|jq .inbounds|jq -c '.[].settings.clients'|jq -c '.[].id'|while read row do @@ -1858,6 +1858,23 @@ resetUUID(){ handleV2Ray stop handleV2Ray start resetStatus=true + elif [[ -d "/etc/v2ray-agent" ]] && [[ -d "/etc/v2ray-agent/v2ray" ]] && [[ -d "/etc/v2ray-agent/v2ray/conf" ]] && [[ ! -z "${customInstallType}" ]] + then + ls /etc/v2ray-agent/v2ray/conf|grep inbounds|while read row + do + cat /etc/v2ray-agent/v2ray/conf/${row}|jq .inbounds|jq -c '.[].settings.clients'|jq -c '.[].id'|while read row2 + do + oldUUID=`echo ${row2}|awk -F "[\"]" '{print $2}'` + newUUID=`/etc/v2ray-agent/v2ray/v2ctl uuid` + echoContent red "旧:${oldUUID}" + echoContent red "新UUID:${newUUID}" + sed -i "s/${oldUUID}/${newUUID}/g" `grep "${oldUUID}" -rl /etc/v2ray-agent/v2ray/conf/${row}` + done + done + echoContent green " ---> V2Ray UUID重置完毕" + handleV2Ray stop + handleV2Ray start + resetStatus=true else echoContent red " ---> 未使用脚本安装V2Ray" menu @@ -1978,7 +1995,7 @@ menu(){ cd echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.0.17" + echoContent green "当前版本:v2.0.18" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:七合一共存脚本" echoContent red "=============================================================="