From ac180a99d1d11548da246aff025c42f60b7a5915 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Wed, 18 Oct 2023 17:54:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=97=B6=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=94=A8=E6=88=B7=E5=90=8D=E3=80=81=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E6=97=B6=E5=8F=AF=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89email=E3=80=81=E4=BF=AE=E6=94=B9=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E6=97=B6=E5=8F=AA?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/install.sh b/install.sh index 2cdffa1..8e89ffa 100644 --- a/install.sh +++ b/install.sh @@ -3701,6 +3701,11 @@ initXrayConfig() { uuid=$(/etc/v2ray-agent/xray/xray uuid) fi + echoContent yellow "\n请输入自定义用户名[需合法],[回车]随机随机用户名" + read -r -p '用户名:' customEmail + if [[ -z ${customEmail} ]]; then + customEmail="$(echo "${uuid}" | cut -d "-" -f 1)-VLESS_TCP/TLS_Vision" + fi fi if [[ -z "${addClientsStatus}" && -z "${uuid}" ]]; then @@ -3710,8 +3715,8 @@ initXrayConfig() { fi if [[ -n "${uuid}" ]]; then - currentClients='[{"id":"'${uuid}'","add":"'${add}'","flow":"xtls-rprx-vision","email":"'${uuid}'-VLESS_TCP/TLS_Vision"}]' - echoContent yellow "\n ${uuid}" + currentClients='[{"id":"'${uuid}'","add":"'${add}'","flow":"xtls-rprx-vision","email":"'${customEmail}'"}]' + echoContent yellow "\n ${customEmail}:${uuid}" fi # log @@ -5063,7 +5068,6 @@ customUserEmail() { # 添加用户 addUserXray() { - readConfigHostPathUUID read -r -p "请输入要添加的用户数量:" userNum echo if [[ -z ${userNum} || ${userNum} -le 0 ]]; then @@ -5071,26 +5075,21 @@ addUserXray() { exit 0 fi # 生成用户 - if [[ "${userNum}" == "1" ]]; then - customUUID - customUserEmail - fi + # if [[ "${userNum}" == "1" ]]; then + # customUUID + # customUserEmail + # fi while [[ ${userNum} -gt 0 ]]; do + readConfigHostPathUUID local users= ((userNum--)) || true - if [[ -n "${currentCustomUUID}" ]]; then - uuid=${currentCustomUUID} - else - uuid=$(${ctlPath} uuid) - fi - local email= - if [[ -z "${currentCustomEmail}" ]]; then - email=${uuid} - else - email=${currentCustomEmail} - fi + customUUID + customUserEmail + + uuid=${currentCustomUUID} + email=${currentCustomEmail} # VLESS TCP if echo "${currentInstallProtocolType}" | grep -q 0; then @@ -5174,7 +5173,6 @@ addUserXray() { echo "${clients}" | jq . >"${singBoxConfigPath}config/tuic.json" fi done - reloadCore echoContent green " ---> 添加完成" manageAccount 1 @@ -8153,7 +8151,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.11.5" + echoContent green "当前版本:v2.11.6" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus