fix(脚本): 修复添加账号无法对vision添加的问题、修复卸载socks5分流后无法正常使用问题、添加查看socks5分流规则时展示账号信息

pull/1054/head^2
mack-a 2024-05-31 14:20:19 +08:00
parent 2b76bb7fb1
commit 5960e10a6a
1 changed files with 40 additions and 13 deletions

View File

@ -4262,6 +4262,7 @@ EOF
installSniffing
removeXrayOutbound IPv4_out
removeXrayOutbound IPv6_out
removeXrayOutbound socks5_outbound
removeXrayOutbound blackhole_out
removeXrayOutbound wireguard_out_IPv6
removeXrayOutbound wireguard_out_IPv4
@ -5723,8 +5724,8 @@ addUser() {
elif [[ "${coreInstallType}" == "2" ]]; then
clients=$(initSingBoxClients 0 "${uuid}" "${email}")
fi
clients=$(jq -r "${userConfig} = ${clients}" ${configPath}${frontingType}.json)
echo "${clients}" | jq . >${configPath}${frontingType}.json
clients=$(jq -r "${userConfig} = ${clients}" ${configPath}02_VLESS_TCP_inbounds.json)
echo "${clients}" | jq . >${configPath}02_VLESS_TCP_inbounds.json
fi
# VLESS WS
@ -6998,8 +6999,12 @@ showSingBoxRoutingRules() {
jq .route.rules "${singBoxConfigPath}$1.json"
elif [[ "$1" == "socks5_outbound_route" && -f "${singBoxConfigPath}socks5_outbound.json" ]]; then
echoContent yellow "已安装 sing-box socks5全局出站分流"
echoContent yellow "\n出站分流配置"
echoContent skyBlue "$(jq .outbounds[0] ${singBoxConfigPath}socks5_outbound.json)"
elif [[ "$1" == "socks5_inbound_route" && -f "${singBoxConfigPath}20_socks5_inbounds.json" ]]; then
echoContent yellow "已安装 sing-box socks5全局入站分流"
echoContent yellow "\n出站分流配置"
echoContent skyBlue "$(jq .outbounds[0] ${singBoxConfigPath}socks5_outbound.json)"
fi
fi
}
@ -7009,8 +7014,15 @@ showXrayRoutingRules() {
if [[ "${coreInstallType}" == "1" ]]; then
if [[ -f "${configPath}09_routing.json" ]]; then
jq ".routing.rules[]|select(.outboundTag==\"$1\")" "${configPath}09_routing.json"
echoContent yellow "\n已安装 xray-core socks5全局出站分流"
echoContent yellow "\n出站分流配置"
echoContent skyBlue "$(jq .outbounds[0].settings.servers[0] ${configPath}socks5_outbound.json)"
elif [[ "$1" == "socks5_outbound" && -f "${configPath}socks5_outbound.json" ]]; then
echoContent yellow "\n已安装 sing-box socks5全局出站分流"
echoContent yellow "\n已安装 xray-core socks5全局出站分流"
echoContent yellow "\n出站分流配置"
echoContent skyBlue "$(jq .outbounds[0].settings.servers[0] ${configPath}socks5_outbound.json)"
fi
fi
}
@ -7025,11 +7037,18 @@ removeSocks5Routing() {
echoContent yellow "3.卸载全部"
read -r -p "请选择:" unInstallSocks5RoutingStatus
if [[ "${unInstallSocks5RoutingStatus}" == "1" ]]; then
removeXrayOutbound socks5_outbound
unInstallRouting socks5_outbound outboundTag
if [[ "${coreInstallType}" == "1" ]]; then
removeXrayOutbound socks5_outbound
unInstallRouting socks5_outbound outboundTag
addXrayOutbound z_direct_outbound
fi
if [[ -n "${singBoxConfigPath}" ]]; then
removeSingBoxConfig socks5_outbound
removeSingBoxConfig socks5_outbound_route
addSingBoxOutbound 01_direct_outbound
fi
removeSingBoxConfig socks5_outbound_route
removeSingBoxConfig socks5_inbound_route
elif [[ "${unInstallSocks5RoutingStatus}" == "2" ]]; then
removeSingBoxConfig 20_socks5_inbounds
@ -7037,11 +7056,20 @@ removeSocks5Routing() {
handleSingBox stop
elif [[ "${unInstallSocks5RoutingStatus}" == "3" ]]; then
removeSingBoxConfig 20_socks5_inbounds
removeSingBoxConfig socks5_inbound_route
if [[ "${coreInstallType}" == "1" ]]; then
removeXrayOutbound socks5_outbound
unInstallRouting socks5_outbound outboundTag
addXrayOutbound z_direct_outbound
fi
if [[ -n "${singBoxConfigPath}" ]]; then
removeSingBoxConfig socks5_outbound
removeSingBoxConfig socks5_outbound_route
removeSingBoxConfig 20_socks5_inbounds
removeSingBoxConfig socks5_inbound_route
addSingBoxOutbound 01_direct_outbound
fi
removeXrayOutbound socks5_outbound
unInstallRouting socks5_outbound outboundTag
handleSingBox stop
else
echoContent red " ---> 选择错误"
@ -7697,7 +7725,6 @@ customXrayInstall() {
exit 0
fi
if [[ "${selectCustomInstallType}" == "7" ]]; then
selectCustomInstallType=",${selectCustomInstallType},"
else
@ -9171,7 +9198,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者mack-a"
echoContent green "当前版本v3.2.55"
echoContent green "当前版本v3.3.1"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus