fix(脚本): 修改sing-box黑名单无法正常访问问题、修改xray-core内核下出站优先级导致的无法访问问题、增加重新安装删除分流配置

pull/931/head
mack-a 2024-01-30 16:08:42 +08:00
parent eb971268fa
commit 4c8c90e18e
1 changed files with 32 additions and 19 deletions

View File

@ -3332,7 +3332,7 @@ EOF
{
"protocol":"freedom",
"settings": {},
"tag":"direct"
"tag":"${tag}"
}
]
}
@ -3345,7 +3345,7 @@ EOF
"outbounds":[
{
"protocol":"blackhole",
"tag":"blackhole_out"
"tag":"${tag}"
}
]
}
@ -3358,7 +3358,7 @@ EOF
"outbounds": [
{
"protocol": "socks",
"tag": "socks5_outbound",
"tag": "${tag}",
"settings": {
"servers": [
{
@ -3763,7 +3763,7 @@ EOF
EOF
fi
addXrayOutbound direct
addXrayOutbound "z_direct_outbound"
# dns
if [[ ! -f "/etc/v2ray-agent/xray/conf/11_dns.json" ]]; then
cat <<EOF >/etc/v2ray-agent/xray/conf/11_dns.json
@ -3777,7 +3777,6 @@ EOF
EOF
fi
# routing
if [[ ! -f "/etc/v2ray-agent/xray/conf/09_routing.json" ]]; then
cat <<EOF >/etc/v2ray-agent/xray/conf/09_routing.json
{
"routing": {
@ -3788,13 +3787,12 @@ EOF
"domain:gstatic.com",
"domain:googleapis.com"
],
"outboundTag": "direct"
"outboundTag": "z_direct_outbound"
}
]
}
}
EOF
fi
# VLESS_TCP_TLS_Vision
# 回落nginx
local fallbacksList='{"dest":31300,"xver":0},{"alpn":"h2","dest":31302,"xver":0}'
@ -4075,6 +4073,12 @@ EOF
rm /etc/v2ray-agent/xray/conf/08_VLESS_vision_gRPC_inbounds.json >/dev/null 2>&1
fi
installSniffing
removeXrayOutbound IPv4_out
removeXrayOutbound IPv6_out
removeXrayOutbound blackhole_out
removeXrayOutbound wireguard_out_IPv6
removeXrayOutbound wireguard_out_IPv4
addXrayOutbound z_direct_outbound
}
# 初始化TCP Brutal
@ -4403,6 +4407,15 @@ EOF
elif [[ -z "$3" ]]; then
rm /etc/v2ray-agent/sing-box/conf/config/10_naive_inbounds.json >/dev/null 2>&1
fi
removeSingBoxConfig wireguard_out_IPv4
removeSingBoxConfig wireguard_out_IPv6
removeSingBoxConfig IPv4_out
removeSingBoxConfig IPv6_out
removeSingBoxConfig block
removeSingBoxConfig cn_block_outbound
removeSingBoxConfig cn_block_route
removeSingBoxConfig 01_direct_outbound
removeSingBoxConfig block_domain_outbound
}
# 初始化Xray Reality配置
# 自定义CDN IP
@ -5826,7 +5839,7 @@ ipv6Routing() {
if [[ -n "${singBoxConfigPath}" ]]; then
addSingBoxRouteRule "IPv6_out" "${domainList}" "IPv6_route"
addSingBoxOutbound direct
addSingBoxOutbound 01_direct_out
addSingBoxOutbound IPv6_out
addSingBoxOutbound IPv4_out
fi
@ -5880,7 +5893,7 @@ ipv6Routing() {
unInstallRouting IPv6_out outboundTag
removeXrayOutbound IPv6_out
addXrayOutbound direct
addXrayOutbound "z_direct_outbound"
fi
@ -6007,7 +6020,7 @@ blacklist() {
if [[ -n "${singBoxConfigPath}" ]]; then
addSingBoxRouteRule "block_domain_outbound" "${domainList}" "block_domain_route"
addSingBoxOutbound "block_domain_outbound"
addSingBoxOutbound "direct"
addSingBoxOutbound "01_direct_outbound"
fi
echoContent green " ---> 添加完毕"
@ -6022,7 +6035,7 @@ blacklist() {
if [[ -n "${singBoxConfigPath}" ]]; then
addSingBoxRouteRule "cn_block_outbound" "cn" "cn_block_route"
addSingBoxOutbound "cn_block_outbound"
addSingBoxOutbound "direct"
addSingBoxOutbound "01_direct_outbound"
fi
echoContent green " ---> 屏蔽国内域名完毕"
@ -6227,7 +6240,7 @@ addWireGuardRoute() {
# xray
if [[ "${coreInstallType}" == "1" ]]; then
addInstallRouting wireguard_out_"${type}" "${tag}" "${domainList}"
addInstallRouting "wireguard_out_${type}" "${tag}" "${domainList}"
addXrayOutbound "wireguard_out_${type}"
fi
# sing-box
@ -6236,7 +6249,7 @@ addWireGuardRoute() {
# rule
addSingBoxRouteRule "wireguard_out_${type}" "${domainList}" "wireguard_out_${type}_route"
addSingBoxOutbound "wireguard_out_${type}" "wireguard_out"
addSingBoxOutbound direct
addSingBoxOutbound "01_direct_outbound"
# outbound
addSingBoxWireGuardOut
fi
@ -6710,7 +6723,7 @@ initSingBoxRules() {
geositeStatus=$(curl -s "https://api.github.com/repos/SagerNet/sing-geosite/contents/geosite-${line}.srs?ref=rule-set" | jq .message)
if [[ "${geositeStatus}" == "null" ]]; then
ruleSet=$(echo "${ruleSet}" | jq -r ". += [{\"tag\":\"${line}_$2\",\"type\":\"remote\",\"format\":\"binary\",\"url\":\"https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-${line}.srs\",\"download_detour\":\"direct\"}]")
ruleSet=$(echo "${ruleSet}" | jq -r ". += [{\"tag\":\"${line}_$2\",\"type\":\"remote\",\"format\":\"binary\",\"url\":\"https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-${line}.srs\",\"download_detour\":\"01_direct_outbound\"}]")
else
domainRules=$(echo "${domainRules}" | jq -r ". += [\"${line}\"]")
fi
@ -6752,7 +6765,7 @@ setSocks5InboundRouting() {
read -r -p "是否允许所有网站?请选择[y/n]:" socks5InboundRoutingDomainStatus
if [[ "${socks5InboundRoutingDomainStatus}" == "y" ]]; then
addSingBoxOutbound direct
addSingBoxOutbound "01_direct_outbound"
else
echoContent yellow "录入示例:netflix,openai,v2ray-agent.com\n"
read -r -p "域名:" socks5InboundRoutingDomain
@ -6767,7 +6780,7 @@ setSocks5InboundRouting() {
echo "${route}" | jq . >"${singBoxConfigPath}socks5_inbound_route.json"
addSingBoxOutbound block
addSingBoxOutbound direct
addSingBoxOutbound "01_direct_outbound"
fi
}
@ -6844,7 +6857,7 @@ setSocks5OutboundRouting() {
exit 0
fi
addSingBoxRouteRule "socks5_outbound" "${socks5RoutingOutboundDomain}" "socks5_outbound_route"
addSingBoxOutbound direct
addSingBoxOutbound "01_direct_outbound"
if [[ "${coreInstallType}" == "1" ]]; then
@ -8700,7 +8713,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者mack-a"
echoContent green "当前版本v3.2.3"
echoContent green "当前版本v3.2.4"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus