diff --git a/install.sh b/install.sh index 49d27bf..997636f 100644 --- a/install.sh +++ b/install.sh @@ -4424,6 +4424,7 @@ EOF removeSingBoxConfig cn_block_route removeSingBoxConfig 01_direct_outbound removeSingBoxConfig block_domain_outbound + removeSingBoxConfig dns } # 初始化 sing-box订阅配置 initSubscribeLocalConfig() { @@ -5590,7 +5591,7 @@ removeUser() { if [[ "${coreInstallType}" == "1" ]]; then jq -r -c .inbounds[0].settings.clients[].email ${configPath}${userConfigType}.json | awk '{print NR""":"$0}' 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 read -r -p "请选择要删除的用户编号[仅支持单个删除]:" delUserIndex @@ -5622,19 +5623,19 @@ removeUser() { if echo ${currentInstallProtocolType} | grep -q ",3,"; then 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 fi if echo ${currentInstallProtocolType} | grep -q ",5,"; then 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 fi if echo ${currentInstallProtocolType} | grep -q ",4,"; then 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 fi @@ -5651,14 +5652,19 @@ removeUser() { if echo ${currentInstallProtocolType} | grep -q ",6,"; then 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" fi if echo ${currentInstallProtocolType} | grep -q ",9,"; then 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" 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 fi manageAccount 1 @@ -7265,7 +7271,8 @@ setUnlockDNS() { # 移除 DNS分流 removeUnlockDNS() { - cat <${configPath}11_dns.json + if [[ "${coreInstallType}" == "1" && -f "${configPath}11_dns.json" ]]; then + cat <${configPath}11_dns.json { "dns": { "servers": [ @@ -7274,6 +7281,22 @@ removeUnlockDNS() { } } EOF + fi + + if [[ "${coreInstallType}" == "2" && -f "${singBoxConfigPath}dns.json" ]]; then + cat <${singBoxConfigPath}dns.json +{ + "dns": { + "servers":[ + { + "address":"local" + } + ] + } +} +EOF + fi + reloadCore echoContent green " ---> 卸载成功" @@ -8801,7 +8824,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" 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 "描述:八合一共存脚本\c" showInstallStatus