From d485f96b7a3d136a73484d7ce393ddcd5986867d Mon Sep 17 00:00:00 2001 From: Wizard <66345978+Wizard89@users.noreply.github.com> Date: Tue, 21 May 2024 17:58:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E5=A4=8Dso?= =?UTF-8?q?cks5=E5=85=A8=E5=B1=80=E5=88=86=E6=B5=81=E5=85=A5=E7=AB=99?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=99=90=E5=88=B6IP=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=81=E4=BF=AE=E5=A4=8DCDN=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0IPv6=E8=AF=BB=E5=8F=96=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index ce37be5..71b800e 100644 --- a/install.sh +++ b/install.sh @@ -849,8 +849,8 @@ readConfigHostPathUUID() { currentPath=${currentPath::-2} fi fi - if [[ -f "/etc/v2ray-agent/cdn" ]] && grep -q "address" "/etc/v2ray-agent/cdn"; then - currentCDNAddress=$(grep "address" "/etc/v2ray-agent/cdn" | awk -F "[:]" '{print $2}') + if [[ -f "/etc/v2ray-agent/cdn" ]] && [[ -n "$(head -1 /etc/v2ray-agent/cdn)" ]]; then + currentCDNAddress=$(head -1 /etc/v2ray-agent/cdn" | awk -F "[:]" '{print $2}') else currentCDNAddress="${currentHost}" fi @@ -5585,9 +5585,6 @@ unInstall() { manageCDN() { echoContent skyBlue "\n进度 $1/1 : CDN节点管理" local setCDNDomain= - if [[ ! -f "/etc/v2ray-agent/cdn" ]]; then - touch "/etc/v2ray-agent/cdn" - fi if echo "${currentInstallProtocolType}" | grep -qE ",1,|,2,|,3,|,5,"; then echoContent red "==============================================================" @@ -5625,15 +5622,15 @@ manageCDN() { read -r -p "请输入想要自定义CDN IP或者域名:" setCDNDomain ;; 7) - sed -i "1d" "/etc/v2ray-agent/cdn" + echo >/etc/v2ray-agent/cdn" echoContent green " ---> 移除成功" exit 0 ;; esac if [[ -n "${setCDNDomain}" ]]; then - sed -i "1d" "/etc/v2ray-agent/cdn" - test -s "/etc/v2ray-agent/cdn" && sed -i "1i address:${setCDNDomain}" "/etc/v2ray-agent/cdn" || echo "address:${setCDNDomain}" >"/etc/v2ray-agent/cdn" + echo >/etc/v2ray-agent/cdn" + echo "${setCDNDomain}" >"/etc/v2ray-agent/cdn" echoContent green " ---> 修改CDN成功,重新查看用户管理或者订阅后生成新的节点内容" else echoContent red " ---> 不可以为空,请重新输入" @@ -7159,6 +7156,13 @@ setSocks5InboundRouting() { read -r -p "是否允许所有网站?请选择[y/n]:" socks5InboundRoutingDomainStatus if [[ "${socks5InboundRoutingDomainStatus}" == "y" ]]; then + addSingBoxRouteRule "01_direct_outbound" "" "socks5_inbound_route" + local route= + route=$(jq ".route.rules[0].inbound = [\"socks5_inbound\"]" "${singBoxConfigPath}socks5_inbound_route.json") + route=$(echo "${route}" | jq ".route.rules[0].source_ip_cidr=${socks5InboundRoutingIPs}") + echo "${route}" | jq . >"${singBoxConfigPath}socks5_inbound_route.json" + + addSingBoxOutbound block addSingBoxOutbound "01_direct_outbound" else echoContent yellow "录入示例:netflix,openai,v2ray-agent.com\n" @@ -9188,7 +9192,7 @@ menu() { echoContent red "\n==============================================================" echoContent green "原作者:mack-a" echoContent green "作者:Wizard89" - echoContent green "当前版本:v3.0.53" + echoContent green "当前版本:v3.0.54" echoContent green "Github:https://github.com/Wizard89/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus