Skip to content

Commit

Permalink
fix(脚本): 修改sing-box黑名单无法正常访问问题、修改xray-core内核下出站优先级导致的无法访问问题、增加重新安装删除分流配置
Browse files Browse the repository at this point in the history
  • Loading branch information
mack-a committed Jan 30, 2024
1 parent eb97126 commit 4c8c90e
Showing 1 changed file with 32 additions and 19 deletions.
51 changes: 32 additions & 19 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,7 @@ EOF
{
"protocol":"freedom",
"settings": {},
"tag":"direct"
"tag":"${tag}"
}
]
}
Expand All @@ -3345,7 +3345,7 @@ EOF
"outbounds":[
{
"protocol":"blackhole",
"tag":"blackhole_out"
"tag":"${tag}"
}
]
}
Expand All @@ -3358,7 +3358,7 @@ EOF
"outbounds": [
{
"protocol": "socks",
"tag": "socks5_outbound",
"tag": "${tag}",
"settings": {
"servers": [
{
Expand Down Expand Up @@ -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
Expand All @@ -3777,8 +3777,7 @@ 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
cat <<EOF >/etc/v2ray-agent/xray/conf/09_routing.json
{
"routing": {
"rules": [
Expand All @@ -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}'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -5880,7 +5893,7 @@ ipv6Routing() {
unInstallRouting IPv6_out outboundTag

removeXrayOutbound IPv6_out
addXrayOutbound direct
addXrayOutbound "z_direct_outbound"

fi

Expand Down Expand Up @@ -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 " ---> 添加完毕"

Expand All @@ -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 " ---> 屏蔽国内域名完毕"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -6767,7 +6780,7 @@ setSocks5InboundRouting() {
echo "${route}" | jq . >"${singBoxConfigPath}socks5_inbound_route.json"

addSingBoxOutbound block
addSingBoxOutbound direct
addSingBoxOutbound "01_direct_outbound"
fi

}
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 "Github:https://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus
Expand Down

0 comments on commit 4c8c90e

Please sign in to comment.