mirror of https://github.com/mack-a/v2ray-agent
fix(脚本): 修复sing-box naive无法删除用户问题、修复sing-box卸载dns分流报错问题
parent
5830e6bfb8
commit
4ae549a5bb
37
install.sh
37
install.sh
|
@ -4424,6 +4424,7 @@ EOF
|
||||||
removeSingBoxConfig cn_block_route
|
removeSingBoxConfig cn_block_route
|
||||||
removeSingBoxConfig 01_direct_outbound
|
removeSingBoxConfig 01_direct_outbound
|
||||||
removeSingBoxConfig block_domain_outbound
|
removeSingBoxConfig block_domain_outbound
|
||||||
|
removeSingBoxConfig dns
|
||||||
}
|
}
|
||||||
# 初始化 sing-box订阅配置
|
# 初始化 sing-box订阅配置
|
||||||
initSubscribeLocalConfig() {
|
initSubscribeLocalConfig() {
|
||||||
|
@ -5590,7 +5591,7 @@ removeUser() {
|
||||||
if [[ "${coreInstallType}" == "1" ]]; then
|
if [[ "${coreInstallType}" == "1" ]]; then
|
||||||
jq -r -c .inbounds[0].settings.clients[].email ${configPath}${userConfigType}.json | awk '{print NR""":"$0}'
|
jq -r -c .inbounds[0].settings.clients[].email ${configPath}${userConfigType}.json | awk '{print NR""":"$0}'
|
||||||
elif [[ "${coreInstallType}" == "2" ]]; then
|
elif [[ "${coreInstallType}" == "2" ]]; then
|
||||||
jq -r -c .inbounds[0].users[].name ${configPath}${userConfigType}.json | awk '{print NR""":"$0}'
|
jq -r -c .inbounds[0].users[].name//.inbounds[0].users[].username ${configPath}${userConfigType}.json | awk '{print NR""":"$0}'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -r -p "请选择要删除的用户编号[仅支持单个删除]:" delUserIndex
|
read -r -p "请选择要删除的用户编号[仅支持单个删除]:" delUserIndex
|
||||||
|
@ -5622,19 +5623,19 @@ removeUser() {
|
||||||
|
|
||||||
if echo ${currentInstallProtocolType} | grep -q ",3,"; then
|
if echo ${currentInstallProtocolType} | grep -q ",3,"; then
|
||||||
local vmessWSResult
|
local vmessWSResult
|
||||||
vmessWSResult=$(jq -r 'del(.inbounds[0].settings.clients['${delUserIndex}'])' ${configPath}05_VMess_WS_inbounds.json)
|
vmessWSResult=$(jq -r 'del(.inbounds[0].settings.clients['${delUserIndex}']//.inbounds[0].users['${delUserIndex}'])' ${configPath}05_VMess_WS_inbounds.json)
|
||||||
echo "${vmessWSResult}" | jq . >${configPath}05_VMess_WS_inbounds.json
|
echo "${vmessWSResult}" | jq . >${configPath}05_VMess_WS_inbounds.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if echo ${currentInstallProtocolType} | grep -q ",5,"; then
|
if echo ${currentInstallProtocolType} | grep -q ",5,"; then
|
||||||
local vlessGRPCResult
|
local vlessGRPCResult
|
||||||
vlessGRPCResult=$(jq -r 'del(.inbounds[0].settings.clients['${delUserIndex}'])' ${configPath}06_VLESS_gRPC_inbounds.json)
|
vlessGRPCResult=$(jq -r 'del(.inbounds[0].settings.clients['${delUserIndex}']//.inbounds[0].users['${delUserIndex}'])' ${configPath}06_VLESS_gRPC_inbounds.json)
|
||||||
echo "${vlessGRPCResult}" | jq . >${configPath}06_VLESS_gRPC_inbounds.json
|
echo "${vlessGRPCResult}" | jq . >${configPath}06_VLESS_gRPC_inbounds.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if echo ${currentInstallProtocolType} | grep -q ",4,"; then
|
if echo ${currentInstallProtocolType} | grep -q ",4,"; then
|
||||||
local trojanTCPResult
|
local trojanTCPResult
|
||||||
trojanTCPResult=$(jq -r 'del(.inbounds[0].settings.clients['${delUserIndex}'])' ${configPath}04_trojan_TCP_inbounds.json)
|
trojanTCPResult=$(jq -r 'del(.inbounds[0].settings.clients['${delUserIndex}']//.inbounds[0].users['${delUserIndex}'])' ${configPath}04_trojan_TCP_inbounds.json)
|
||||||
echo "${trojanTCPResult}" | jq . >${configPath}04_trojan_TCP_inbounds.json
|
echo "${trojanTCPResult}" | jq . >${configPath}04_trojan_TCP_inbounds.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -5651,14 +5652,19 @@ removeUser() {
|
||||||
|
|
||||||
if echo ${currentInstallProtocolType} | grep -q ",6,"; then
|
if echo ${currentInstallProtocolType} | grep -q ",6,"; then
|
||||||
local hysteriaResult
|
local hysteriaResult
|
||||||
hysteriaResult=$(jq -r 'del(.inbounds[0].users['${delUserIndex}'])' "${singBoxConfigPath}06_hysteria2_inbounds.json")
|
hysteriaResult=$(jq -r 'del(.inbounds[0].users['${delUserIndex}']//.inbounds[0].users['${delUserIndex}'])' "${singBoxConfigPath}06_hysteria2_inbounds.json")
|
||||||
echo "${hysteriaResult}" | jq . >"${singBoxConfigPath}06_hysteria2_inbounds.json"
|
echo "${hysteriaResult}" | jq . >"${singBoxConfigPath}06_hysteria2_inbounds.json"
|
||||||
fi
|
fi
|
||||||
if echo ${currentInstallProtocolType} | grep -q ",9,"; then
|
if echo ${currentInstallProtocolType} | grep -q ",9,"; then
|
||||||
local tuicResult
|
local tuicResult
|
||||||
tuicResult=$(jq -r 'del(.inbounds[0].users['${delUserIndex}'])' "${singBoxConfigPath}09_tuic_inbounds.json")
|
tuicResult=$(jq -r 'del(.inbounds[0].users['${delUserIndex}']//.inbounds[0].users['${delUserIndex}'])' "${singBoxConfigPath}09_tuic_inbounds.json")
|
||||||
echo "${tuicResult}" | jq . >"${singBoxConfigPath}09_tuic_inbounds.json"
|
echo "${tuicResult}" | jq . >"${singBoxConfigPath}09_tuic_inbounds.json"
|
||||||
fi
|
fi
|
||||||
|
if echo ${currentInstallProtocolType} | grep -q ",10,"; then
|
||||||
|
local naiveResult
|
||||||
|
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
|
||||||
reloadCore
|
reloadCore
|
||||||
fi
|
fi
|
||||||
manageAccount 1
|
manageAccount 1
|
||||||
|
@ -7265,6 +7271,7 @@ setUnlockDNS() {
|
||||||
|
|
||||||
# 移除 DNS分流
|
# 移除 DNS分流
|
||||||
removeUnlockDNS() {
|
removeUnlockDNS() {
|
||||||
|
if [[ "${coreInstallType}" == "1" && -f "${configPath}11_dns.json" ]]; then
|
||||||
cat <<EOF >${configPath}11_dns.json
|
cat <<EOF >${configPath}11_dns.json
|
||||||
{
|
{
|
||||||
"dns": {
|
"dns": {
|
||||||
|
@ -7274,6 +7281,22 @@ removeUnlockDNS() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${coreInstallType}" == "2" && -f "${singBoxConfigPath}dns.json" ]]; then
|
||||||
|
cat <<EOF >${singBoxConfigPath}dns.json
|
||||||
|
{
|
||||||
|
"dns": {
|
||||||
|
"servers":[
|
||||||
|
{
|
||||||
|
"address":"local"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
reloadCore
|
reloadCore
|
||||||
|
|
||||||
echoContent green " ---> 卸载成功"
|
echoContent green " ---> 卸载成功"
|
||||||
|
@ -8801,7 +8824,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.2.37"
|
echoContent green "当前版本:v3.2.38"
|
||||||
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