mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 首次安装时可以自定义用户名、批量添加用户时可自定义email、修改批量添加用户时只添加一个的问题
parent
68dc7554c5
commit
ac180a99d1
38
install.sh
38
install.sh
|
@ -3701,6 +3701,11 @@ initXrayConfig() {
|
||||||
uuid=$(/etc/v2ray-agent/xray/xray uuid)
|
uuid=$(/etc/v2ray-agent/xray/xray uuid)
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
if [[ -z "${addClientsStatus}" && -z "${uuid}" ]]; then
|
if [[ -z "${addClientsStatus}" && -z "${uuid}" ]]; then
|
||||||
|
@ -3710,8 +3715,8 @@ initXrayConfig() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${uuid}" ]]; then
|
if [[ -n "${uuid}" ]]; then
|
||||||
currentClients='[{"id":"'${uuid}'","add":"'${add}'","flow":"xtls-rprx-vision","email":"'${uuid}'-VLESS_TCP/TLS_Vision"}]'
|
currentClients='[{"id":"'${uuid}'","add":"'${add}'","flow":"xtls-rprx-vision","email":"'${customEmail}'"}]'
|
||||||
echoContent yellow "\n ${uuid}"
|
echoContent yellow "\n ${customEmail}:${uuid}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# log
|
# log
|
||||||
|
@ -5063,7 +5068,6 @@ customUserEmail() {
|
||||||
|
|
||||||
# 添加用户
|
# 添加用户
|
||||||
addUserXray() {
|
addUserXray() {
|
||||||
readConfigHostPathUUID
|
|
||||||
read -r -p "请输入要添加的用户数量:" userNum
|
read -r -p "请输入要添加的用户数量:" userNum
|
||||||
echo
|
echo
|
||||||
if [[ -z ${userNum} || ${userNum} -le 0 ]]; then
|
if [[ -z ${userNum} || ${userNum} -le 0 ]]; then
|
||||||
|
@ -5071,26 +5075,21 @@ addUserXray() {
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# 生成用户
|
# 生成用户
|
||||||
if [[ "${userNum}" == "1" ]]; then
|
# if [[ "${userNum}" == "1" ]]; then
|
||||||
customUUID
|
# customUUID
|
||||||
customUserEmail
|
# customUserEmail
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
while [[ ${userNum} -gt 0 ]]; do
|
while [[ ${userNum} -gt 0 ]]; do
|
||||||
|
readConfigHostPathUUID
|
||||||
local users=
|
local users=
|
||||||
((userNum--)) || true
|
((userNum--)) || true
|
||||||
|
|
||||||
if [[ -n "${currentCustomUUID}" ]]; then
|
customUUID
|
||||||
uuid=${currentCustomUUID}
|
customUserEmail
|
||||||
else
|
|
||||||
uuid=$(${ctlPath} uuid)
|
uuid=${currentCustomUUID}
|
||||||
fi
|
email=${currentCustomEmail}
|
||||||
local email=
|
|
||||||
if [[ -z "${currentCustomEmail}" ]]; then
|
|
||||||
email=${uuid}
|
|
||||||
else
|
|
||||||
email=${currentCustomEmail}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# VLESS TCP
|
# VLESS TCP
|
||||||
if echo "${currentInstallProtocolType}" | grep -q 0; then
|
if echo "${currentInstallProtocolType}" | grep -q 0; then
|
||||||
|
@ -5174,7 +5173,6 @@ addUserXray() {
|
||||||
echo "${clients}" | jq . >"${singBoxConfigPath}config/tuic.json"
|
echo "${clients}" | jq . >"${singBoxConfigPath}config/tuic.json"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
reloadCore
|
reloadCore
|
||||||
echoContent green " ---> 添加完成"
|
echoContent green " ---> 添加完成"
|
||||||
manageAccount 1
|
manageAccount 1
|
||||||
|
@ -8153,7 +8151,7 @@ menu() {
|
||||||
cd "$HOME" || exit
|
cd "$HOME" || exit
|
||||||
echoContent red "\n=============================================================="
|
echoContent red "\n=============================================================="
|
||||||
echoContent green "作者:mack-a"
|
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 "Github:https://github.com/mack-a/v2ray-agent"
|
||||||
echoContent green "描述:八合一共存脚本\c"
|
echoContent green "描述:八合一共存脚本\c"
|
||||||
showInstallStatus
|
showInstallStatus
|
||||||
|
|
Loading…
Reference in New Issue