fix(脚本): 修复HTTPUpgrade无法添加和删除用户问题

pull/1073/head
mack-a 2024-07-05 17:12:47 +08:00
parent 4bdb97ddc1
commit 9f4bf083bd
1 changed files with 20 additions and 1 deletions

View File

@ -6048,6 +6048,18 @@ addUser() {
echo "${clients}" | jq . >"${singBoxConfigPath}10_naive_inbounds.json"
fi
# VMess WS
if echo "${currentInstallProtocolType}" | grep -q ",11,"; then
local clients=
if [[ "${coreInstallType}" == "1" ]]; then
clients=$(initXrayClients 11 "${uuid}" "${email}")
elif [[ "${coreInstallType}" == "2" ]]; then
clients=$(initSingBoxClients 11 "${uuid}" "${email}")
fi
clients=$(jq -r "${userConfig} = ${clients}" ${configPath}11_VMess_HTTPUpgrade_inbounds.json)
echo "${clients}" | jq . >${configPath}11_VMess_HTTPUpgrade_inbounds.json
fi
done
reloadCore
echoContent green " ---> 添加完成"
@ -6141,6 +6153,13 @@ removeUser() {
naiveResult=$(jq -r 'del(.inbounds[0].users['${delUserIndex}']//.inbounds[0].users['${delUserIndex}'])' "${singBoxConfigPath}10_naive_inbounds.json")
echo "${naiveResult}" | jq . >"${singBoxConfigPath}10_naive_inbounds.json"
fi
# VMess HTTPUpgrade
if echo ${currentInstallProtocolType} | grep -q ",11,"; then
local vmessHTTPUpgradeResult
vmessHTTPUpgradeResult=$(jq -r 'del(.inbounds[0].users['${delUserIndex}']//.inbounds[0].users['${delUserIndex}'])' "${singBoxConfigPath}11_VMess_HTTPUpgrade_inbounds.json")
echo "${vmessHTTPUpgradeResult}" | jq . >"${singBoxConfigPath}11_VMess_HTTPUpgrade_inbounds.json"
echo "${vmessHTTPUpgradeResult}" | jq . >${configPath}11_VMess_HTTPUpgrade_inbounds.json
fi
reloadCore
fi
manageAccount 1
@ -9406,7 +9425,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者mack-a"
echoContent green "当前版本v3.3.8"
echoContent green "当前版本v3.3.9"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus