From 65ee35172721178f7ffef0c93022b8e85b514031 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Tue, 23 Mar 2021 11:45:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E4=BC=98=E5=8C=96x?= =?UTF-8?q?ray=E3=80=81v2ray=E5=90=AF=E5=8A=A8=E6=97=B6=E7=9A=84=E7=AD=89?= =?UTF-8?q?=E5=BE=85=E6=97=B6=E9=97=B4=E3=80=81=E6=B7=BB=E5=8A=A0=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=97=B6=E5=8F=AF=E8=87=AA=E5=AE=9A=E4=B9=89uuid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 3e14cd7..47bcb37 100644 --- a/install.sh +++ b/install.sh @@ -1253,7 +1253,7 @@ handleV2Ray() { systemctl stop v2ray.service fi fi - sleep 0.5 + sleep 0.8 if [[ "$1" == "start" ]]; then if [[ -n $(pgrep -f "v2ray/v2ray") ]]; then @@ -1283,7 +1283,7 @@ handleXray() { fi fi - sleep 0.5 + sleep 0.8 if [[ "$1" == "start" ]]; then if [[ -n $(pgrep -f "xray/xray") ]]; then @@ -1363,10 +1363,21 @@ handleTrojanGo() { fi fi } + # 初始化V2Ray 配置文件 initV2RayConfig() { echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化V2Ray配置" - if [[ -n "${currentUUID}" ]]; then + 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 echo read -r -p "读取到上次安装记录,是否使用上次安装时的UUID ?[y/n]:" historyUUIDStatus if [[ "${historyUUIDStatus}" == "y" ]]; then @@ -1374,7 +1385,7 @@ initV2RayConfig() { else uuid=$(/etc/v2ray-agent/v2ray/v2ctl uuid) fi - else + elif [[ -z "${uuid}" ]]; then uuid=$(/etc/v2ray-agent/v2ray/v2ctl uuid) fi @@ -1652,7 +1663,18 @@ EOF # 初始化Xray 配置文件 initXrayConfig() { echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化Xray配置" - if [[ -n "${currentUUID}" ]]; then + 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 echo read -r -p "读取到上次安装记录,是否使用上次安装时的UUID ?[y/n]:" historyUUIDStatus if [[ "${historyUUIDStatus}" == "y" ]]; then @@ -1660,9 +1682,10 @@ initXrayConfig() { else uuid=$(/etc/v2ray-agent/xray/xray uuid) fi - else + elif [[ -z "${uuid}" ]]; then uuid=$(/etc/v2ray-agent/xray/xray uuid) fi + if [[ -z "${uuid}" ]]; then echoContent red "\n ---> uuid读取错误,重新生成" uuid=$(/etc/v2ray-agent/xray/xray uuid) @@ -2183,6 +2206,11 @@ showAccounts() { fi } +# 状态展示 +#showInstallStatus() { +# +#} + # 更新伪装站 updateNginxBlog() { echoContent skyBlue "\n进度 $1/${totalProgress} : 更换伪装站点" @@ -3505,7 +3533,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.4.4" + echoContent green "当前版本:v2.4.5" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:七合一共存脚本" echoContent red "=============================================================="