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