From 0cf5e798b38ed55712328e648c5909a2ecfb2b67 Mon Sep 17 00:00:00 2001 From: DustinWin Date: Mon, 12 Jan 2026 21:12:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20sing-box=20=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E5=97=85=E6=8E=A2=E8=A6=86=E5=86=99=E5=92=8C=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=A6=86=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/starts/singbox_modify.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/starts/singbox_modify.sh b/scripts/starts/singbox_modify.sh index e1c02052..a91edb4a 100644 --- a/scripts/starts/singbox_modify.sh +++ b/scripts/starts/singbox_modify.sh @@ -200,20 +200,21 @@ EOF EOF #生成add_route.json #域名嗅探配置 - [ "$sniffer" = ON ] && sniffer_set='{ "action": "sniff", "timeout": "500ms" },' - [ "$ts_service" = ON ] && tailscale_set='{ "inbound": [ "ts-ep" ], "port": 53, "action": "hijack-dns" },' + [ "$sniffer" = ON ] && ! grep -Eq '"action" *:[[:space:]]*"sniff"' "$CRASHDIR"/jsons/*.json && sniffer_set='{ "action": "sniff", "timeout": "500ms" },' + [ "$ts_service" = ON ] && tailscale_set='{ "inbound": [ "ts-ep" ], "port": 53, "action": "hijack-dns" },' + sed -i '/"clash_mode".*"outbound"/d' "$CRASHDIR"/jsons/*.json cat >"$TMPDIR"/jsons/add_route.json <