mirror of https://github.com/mack-a/v2ray-agent
fix(脚本): 修改sing-box黑名单无法正常访问问题、修改xray-core内核下出站优先级导致的无法访问问题、增加重新安装删除分流配置
parent
eb971268fa
commit
4c8c90e18e
51
install.sh
51
install.sh
|
@ -3332,7 +3332,7 @@ EOF
|
||||||
{
|
{
|
||||||
"protocol":"freedom",
|
"protocol":"freedom",
|
||||||
"settings": {},
|
"settings": {},
|
||||||
"tag":"direct"
|
"tag":"${tag}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -3345,7 +3345,7 @@ EOF
|
||||||
"outbounds":[
|
"outbounds":[
|
||||||
{
|
{
|
||||||
"protocol":"blackhole",
|
"protocol":"blackhole",
|
||||||
"tag":"blackhole_out"
|
"tag":"${tag}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -3358,7 +3358,7 @@ EOF
|
||||||
"outbounds": [
|
"outbounds": [
|
||||||
{
|
{
|
||||||
"protocol": "socks",
|
"protocol": "socks",
|
||||||
"tag": "socks5_outbound",
|
"tag": "${tag}",
|
||||||
"settings": {
|
"settings": {
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
|
@ -3763,7 +3763,7 @@ EOF
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
addXrayOutbound direct
|
addXrayOutbound "z_direct_outbound"
|
||||||
# dns
|
# dns
|
||||||
if [[ ! -f "/etc/v2ray-agent/xray/conf/11_dns.json" ]]; then
|
if [[ ! -f "/etc/v2ray-agent/xray/conf/11_dns.json" ]]; then
|
||||||
cat <<EOF >/etc/v2ray-agent/xray/conf/11_dns.json
|
cat <<EOF >/etc/v2ray-agent/xray/conf/11_dns.json
|
||||||
|
@ -3777,8 +3777,7 @@ EOF
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
# routing
|
# routing
|
||||||
if [[ ! -f "/etc/v2ray-agent/xray/conf/09_routing.json" ]]; then
|
cat <<EOF >/etc/v2ray-agent/xray/conf/09_routing.json
|
||||||
cat <<EOF >/etc/v2ray-agent/xray/conf/09_routing.json
|
|
||||||
{
|
{
|
||||||
"routing": {
|
"routing": {
|
||||||
"rules": [
|
"rules": [
|
||||||
|
@ -3788,13 +3787,12 @@ EOF
|
||||||
"domain:gstatic.com",
|
"domain:gstatic.com",
|
||||||
"domain:googleapis.com"
|
"domain:googleapis.com"
|
||||||
],
|
],
|
||||||
"outboundTag": "direct"
|
"outboundTag": "z_direct_outbound"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
fi
|
|
||||||
# VLESS_TCP_TLS_Vision
|
# VLESS_TCP_TLS_Vision
|
||||||
# 回落nginx
|
# 回落nginx
|
||||||
local fallbacksList='{"dest":31300,"xver":0},{"alpn":"h2","dest":31302,"xver":0}'
|
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
|
rm /etc/v2ray-agent/xray/conf/08_VLESS_vision_gRPC_inbounds.json >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
installSniffing
|
installSniffing
|
||||||
|
removeXrayOutbound IPv4_out
|
||||||
|
removeXrayOutbound IPv6_out
|
||||||
|
removeXrayOutbound blackhole_out
|
||||||
|
removeXrayOutbound wireguard_out_IPv6
|
||||||
|
removeXrayOutbound wireguard_out_IPv4
|
||||||
|
addXrayOutbound z_direct_outbound
|
||||||
}
|
}
|
||||||
|
|
||||||
# 初始化TCP Brutal
|
# 初始化TCP Brutal
|
||||||
|
@ -4403,6 +4407,15 @@ EOF
|
||||||
elif [[ -z "$3" ]]; then
|
elif [[ -z "$3" ]]; then
|
||||||
rm /etc/v2ray-agent/sing-box/conf/config/10_naive_inbounds.json >/dev/null 2>&1
|
rm /etc/v2ray-agent/sing-box/conf/config/10_naive_inbounds.json >/dev/null 2>&1
|
||||||
fi
|
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配置
|
# 初始化Xray Reality配置
|
||||||
# 自定义CDN IP
|
# 自定义CDN IP
|
||||||
|
@ -5826,7 +5839,7 @@ ipv6Routing() {
|
||||||
|
|
||||||
if [[ -n "${singBoxConfigPath}" ]]; then
|
if [[ -n "${singBoxConfigPath}" ]]; then
|
||||||
addSingBoxRouteRule "IPv6_out" "${domainList}" "IPv6_route"
|
addSingBoxRouteRule "IPv6_out" "${domainList}" "IPv6_route"
|
||||||
addSingBoxOutbound direct
|
addSingBoxOutbound 01_direct_out
|
||||||
addSingBoxOutbound IPv6_out
|
addSingBoxOutbound IPv6_out
|
||||||
addSingBoxOutbound IPv4_out
|
addSingBoxOutbound IPv4_out
|
||||||
fi
|
fi
|
||||||
|
@ -5880,7 +5893,7 @@ ipv6Routing() {
|
||||||
unInstallRouting IPv6_out outboundTag
|
unInstallRouting IPv6_out outboundTag
|
||||||
|
|
||||||
removeXrayOutbound IPv6_out
|
removeXrayOutbound IPv6_out
|
||||||
addXrayOutbound direct
|
addXrayOutbound "z_direct_outbound"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6007,7 +6020,7 @@ blacklist() {
|
||||||
if [[ -n "${singBoxConfigPath}" ]]; then
|
if [[ -n "${singBoxConfigPath}" ]]; then
|
||||||
addSingBoxRouteRule "block_domain_outbound" "${domainList}" "block_domain_route"
|
addSingBoxRouteRule "block_domain_outbound" "${domainList}" "block_domain_route"
|
||||||
addSingBoxOutbound "block_domain_outbound"
|
addSingBoxOutbound "block_domain_outbound"
|
||||||
addSingBoxOutbound "direct"
|
addSingBoxOutbound "01_direct_outbound"
|
||||||
fi
|
fi
|
||||||
echoContent green " ---> 添加完毕"
|
echoContent green " ---> 添加完毕"
|
||||||
|
|
||||||
|
@ -6022,7 +6035,7 @@ blacklist() {
|
||||||
if [[ -n "${singBoxConfigPath}" ]]; then
|
if [[ -n "${singBoxConfigPath}" ]]; then
|
||||||
addSingBoxRouteRule "cn_block_outbound" "cn" "cn_block_route"
|
addSingBoxRouteRule "cn_block_outbound" "cn" "cn_block_route"
|
||||||
addSingBoxOutbound "cn_block_outbound"
|
addSingBoxOutbound "cn_block_outbound"
|
||||||
addSingBoxOutbound "direct"
|
addSingBoxOutbound "01_direct_outbound"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echoContent green " ---> 屏蔽国内域名完毕"
|
echoContent green " ---> 屏蔽国内域名完毕"
|
||||||
|
@ -6227,7 +6240,7 @@ addWireGuardRoute() {
|
||||||
# xray
|
# xray
|
||||||
if [[ "${coreInstallType}" == "1" ]]; then
|
if [[ "${coreInstallType}" == "1" ]]; then
|
||||||
|
|
||||||
addInstallRouting wireguard_out_"${type}" "${tag}" "${domainList}"
|
addInstallRouting "wireguard_out_${type}" "${tag}" "${domainList}"
|
||||||
addXrayOutbound "wireguard_out_${type}"
|
addXrayOutbound "wireguard_out_${type}"
|
||||||
fi
|
fi
|
||||||
# sing-box
|
# sing-box
|
||||||
|
@ -6236,7 +6249,7 @@ addWireGuardRoute() {
|
||||||
# rule
|
# rule
|
||||||
addSingBoxRouteRule "wireguard_out_${type}" "${domainList}" "wireguard_out_${type}_route"
|
addSingBoxRouteRule "wireguard_out_${type}" "${domainList}" "wireguard_out_${type}_route"
|
||||||
addSingBoxOutbound "wireguard_out_${type}" "wireguard_out"
|
addSingBoxOutbound "wireguard_out_${type}" "wireguard_out"
|
||||||
addSingBoxOutbound direct
|
addSingBoxOutbound "01_direct_outbound"
|
||||||
# outbound
|
# outbound
|
||||||
addSingBoxWireGuardOut
|
addSingBoxWireGuardOut
|
||||||
fi
|
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)
|
geositeStatus=$(curl -s "https://api.github.com/repos/SagerNet/sing-geosite/contents/geosite-${line}.srs?ref=rule-set" | jq .message)
|
||||||
|
|
||||||
if [[ "${geositeStatus}" == "null" ]]; then
|
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
|
else
|
||||||
domainRules=$(echo "${domainRules}" | jq -r ". += [\"${line}\"]")
|
domainRules=$(echo "${domainRules}" | jq -r ". += [\"${line}\"]")
|
||||||
fi
|
fi
|
||||||
|
@ -6752,7 +6765,7 @@ setSocks5InboundRouting() {
|
||||||
|
|
||||||
read -r -p "是否允许所有网站?请选择[y/n]:" socks5InboundRoutingDomainStatus
|
read -r -p "是否允许所有网站?请选择[y/n]:" socks5InboundRoutingDomainStatus
|
||||||
if [[ "${socks5InboundRoutingDomainStatus}" == "y" ]]; then
|
if [[ "${socks5InboundRoutingDomainStatus}" == "y" ]]; then
|
||||||
addSingBoxOutbound direct
|
addSingBoxOutbound "01_direct_outbound"
|
||||||
else
|
else
|
||||||
echoContent yellow "录入示例:netflix,openai,v2ray-agent.com\n"
|
echoContent yellow "录入示例:netflix,openai,v2ray-agent.com\n"
|
||||||
read -r -p "域名:" socks5InboundRoutingDomain
|
read -r -p "域名:" socks5InboundRoutingDomain
|
||||||
|
@ -6767,7 +6780,7 @@ setSocks5InboundRouting() {
|
||||||
echo "${route}" | jq . >"${singBoxConfigPath}socks5_inbound_route.json"
|
echo "${route}" | jq . >"${singBoxConfigPath}socks5_inbound_route.json"
|
||||||
|
|
||||||
addSingBoxOutbound block
|
addSingBoxOutbound block
|
||||||
addSingBoxOutbound direct
|
addSingBoxOutbound "01_direct_outbound"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6844,7 +6857,7 @@ setSocks5OutboundRouting() {
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
addSingBoxRouteRule "socks5_outbound" "${socks5RoutingOutboundDomain}" "socks5_outbound_route"
|
addSingBoxRouteRule "socks5_outbound" "${socks5RoutingOutboundDomain}" "socks5_outbound_route"
|
||||||
addSingBoxOutbound direct
|
addSingBoxOutbound "01_direct_outbound"
|
||||||
|
|
||||||
if [[ "${coreInstallType}" == "1" ]]; then
|
if [[ "${coreInstallType}" == "1" ]]; then
|
||||||
|
|
||||||
|
@ -8700,7 +8713,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.3"
|
echoContent green "当前版本:v3.2.4"
|
||||||
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