From cf9793fc4dce80cf8303f12320b547d005c9cdf5 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Sat, 3 Jul 2021 16:40:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=97=B6UUID=E7=9A=84=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/install.sh b/install.sh index 3d1e0f5..525c9e9 100644 --- a/install.sh +++ b/install.sh @@ -930,7 +930,7 @@ randomPathFunction() { fi fi - echoContent yellow "path:${currentPath}" + echoContent yellow "\n path:${currentPath}" echoContent skyBlue "\n----------------------------" } # Nginx伪装博客 @@ -1626,6 +1626,7 @@ handleTrojanGo() { initV2RayConfig() { echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化V2Ray配置" echo + read -r -p "是否自定义UUID ?[y/n]:" customUUIDStatus echo if [[ "${customUUIDStatus}" == "y" ]]; then @@ -2066,25 +2067,27 @@ initXrayFrontingConfig(){ initXrayConfig() { echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化Xray配置" echo - read -r -p "是否自定义UUID ?[y/n]:" customUUIDStatus - echo - - if [[ "${customUUIDStatus}" == "y" ]]; then - read -r -p "请输入合法的UUID:" currentCustomUUID - if [[ -n "${currentCustomUUID}" ]]; then - uuid=${currentCustomUUID} - fi - fi - - if [[ -n "${currentUUID}" && -z "${uuid}" ]]; then + local uuid= + if [[ -n "${currentUUID}" ]]; then read -r -p "读取到上次安装记录,是否使用上次安装时的UUID ?[y/n]:" historyUUIDStatus if [[ "${historyUUIDStatus}" == "y" ]]; then uuid=${currentUUID} + echoContent green "\n ---> 使用成功" else uuid=$(/etc/v2ray-agent/xray/xray uuid) fi - elif [[ -z "${uuid}" ]]; then - uuid=$(/etc/v2ray-agent/xray/xray uuid) + fi + + if [[ -z "${uuid}" ]];then + echoContent yellow "请输入自定义UUID[需合法],[回车]随机UUID" + read -r -p 'UUID:' customUUID + + if [[ -n ${customUUID} ]];then + uuid=${customUUID} + else + uuid=$(/etc/v2ray-agent/xray/xray uuid) + fi + fi if [[ -z "${uuid}" ]]; then @@ -2092,7 +2095,7 @@ initXrayConfig() { uuid=$(/etc/v2ray-agent/xray/xray uuid) fi - echoContent green "\n ---> 使用成功" + echoContent yellow "\n ${uuid}" rm -rf /etc/v2ray-agent/xray/conf/* @@ -2283,7 +2286,6 @@ EOF # trojan_grpc if echo ${selectCustomInstallType} | grep -q 2 || [[ "$1" == "all" ]]; then - echo selectCustomInstallType:${selectCustomInstallType} if ! echo ${selectCustomInstallType} | grep -q 5 && [[ -n ${selectCustomInstallType} ]];then fallbacksList=${fallbacksList//31302/31304} fi