mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): sing-box允许添加订阅、修复添加账户失败问题
parent
fff1e83b03
commit
6f293fb161
39
install.sh
39
install.sh
|
@ -5006,14 +5006,15 @@ customUUID() {
|
||||||
echoContent yellow "uuid:${currentCustomUUID}\n"
|
echoContent yellow "uuid:${currentCustomUUID}\n"
|
||||||
|
|
||||||
else
|
else
|
||||||
jq -r -c '.inbounds[0].settings.clients[].id' ${configPath}${frontingType}.json | while read -r line; do
|
local checkUUID=
|
||||||
if [[ "${line}" == "${currentCustomUUID}" ]]; then
|
if [[ "${coreInstallType}" == "1" ]]; then
|
||||||
echo >/tmp/v2ray-agent
|
checkUUID=$(jq -r --arg currentUUID "$currentCustomUUID" ".inbounds[0].settings.clients[] | select(.uuid | index(\$currentUUID) != null) | .name" ${configPath}${frontingType}.json)
|
||||||
|
elif [[ "${coreInstallType}" == "2" ]]; then
|
||||||
|
checkUUID=$(jq -r --arg currentUUID "$currentCustomUUID" ".inbounds[0].users[] | select(.uuid | index(\$currentUUID) != null) | .name" ${configPath}${frontingType}.json)
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
if [[ -f "/tmp/v2ray-agent" && -n $(cat /tmp/v2ray-agent) ]]; then
|
if [[ -n "${checkUUID}" ]]; then
|
||||||
echoContent red " ---> UUID不可重复"
|
echoContent red " ---> UUID不可重复"
|
||||||
rm /tmp/v2ray-agent
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -5027,24 +5028,18 @@ customUserEmail() {
|
||||||
currentCustomEmail="${currentCustomUUID}"
|
currentCustomEmail="${currentCustomUUID}"
|
||||||
echoContent yellow "email: ${currentCustomEmail}\n"
|
echoContent yellow "email: ${currentCustomEmail}\n"
|
||||||
else
|
else
|
||||||
local defaultConfig=${frontingType}
|
local checkEmail=
|
||||||
|
if [[ "${coreInstallType}" == "1" ]]; then
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "7" && [[ -z "${frontingType}" ]]; then
|
checkEmail=$(jq -r --arg currentEmail "$currentCustomEmail" ".inbounds[0].settings.clients[] | select(.name | index(\$currentEmail) != null) | .name" ${configPath}${frontingType}.json)
|
||||||
defaultConfig="07_VLESS_vision_reality_inbounds"
|
elif [[ "${coreInstallType}" == "2" ]]; then
|
||||||
|
checkEmail=$(jq -r --arg currentEmail "$currentCustomEmail" ".inbounds[0].users[] | select(.name | index(\$currentEmail) != null) | .name" ${configPath}${frontingType}.json)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
jq -r -c '.inbounds[0].settings.clients[].email' ${configPath}${defaultConfig}.json | while read -r line; do
|
if [[ -n "${checkEmail}" ]]; then
|
||||||
if [[ "${line}" == "${currentCustomEmail}" ]]; then
|
|
||||||
echo >/tmp/v2ray-agent
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [[ -f "/tmp/v2ray-agent" && -n $(cat /tmp/v2ray-agent) ]]; then
|
|
||||||
echoContent red " ---> email不可重复"
|
echoContent red " ---> email不可重复"
|
||||||
rm /tmp/v2ray-agent
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 添加用户
|
# 添加用户
|
||||||
|
@ -5177,7 +5172,7 @@ addUser() {
|
||||||
|
|
||||||
if [[ "${coreInstallType}" == "1" ]]; then
|
if [[ "${coreInstallType}" == "1" ]]; then
|
||||||
clients=$(initXrayClients 6 "${uuid}" "${email}")
|
clients=$(initXrayClients 6 "${uuid}" "${email}")
|
||||||
elif [[ "${coreInstallType}" == "2" ]]; then
|
elif [[ -n "${singBoxConfigPath}" ]]; then
|
||||||
clients=$(initSingBoxClients 6 "${uuid}" "${email}")
|
clients=$(initSingBoxClients 6 "${uuid}" "${email}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -7162,10 +7157,6 @@ manageAccount() {
|
||||||
elif [[ "${manageAccountStatus}" == "2" ]]; then
|
elif [[ "${manageAccountStatus}" == "2" ]]; then
|
||||||
subscribe
|
subscribe
|
||||||
elif [[ "${manageAccountStatus}" == "3" ]]; then
|
elif [[ "${manageAccountStatus}" == "3" ]]; then
|
||||||
if [[ "${coreInstallType}" == "2" ]]; then
|
|
||||||
echoContent red "\n ---> 此功能仅支持Xray-core内核,请等待后续更新"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
addSubscribeMenu 1
|
addSubscribeMenu 1
|
||||||
elif [[ "${manageAccountStatus}" == "4" ]]; then
|
elif [[ "${manageAccountStatus}" == "4" ]]; then
|
||||||
addUser
|
addUser
|
||||||
|
@ -8290,7 +8281,7 @@ menu() {
|
||||||
cd "$HOME" || exit
|
cd "$HOME" || exit
|
||||||
echoContent red "\n=============================================================="
|
echoContent red "\n=============================================================="
|
||||||
echoContent green "作者:mack-a"
|
echoContent green "作者:mack-a"
|
||||||
echoContent green "当前版本:v3.1.18"
|
echoContent green "当前版本:v3.1.19"
|
||||||
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