From fd4171a5265eb09ed757148bf19aef567bdcca04 Mon Sep 17 00:00:00 2001 From: juewuy Date: Mon, 1 Dec 2025 12:22:37 +0800 Subject: [PATCH] =?UTF-8?q?~singbox1.13=E7=89=88=E6=9C=AC=E5=86=85?= =?UTF-8?q?=E6=A0=B8=E9=80=82=E9=85=8D=E6=97=A7=E7=89=88=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/start.sh | 17 +++++++++-------- scripts/webget.sh | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index 8b61146..0a26d9c 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -282,26 +282,29 @@ check_clash_config() { #检查clash配置文件 } check_singbox_config() { #检查singbox配置文件 #检测节点或providers - if ! grep -qE '"(socks|http|shadowsocks(r)?|vmess|trojan|wireguard|hysteria(2)?|vless|shadowtls|tuic|ssh|tor|providers)"' "$core_config_new"; then + if ! grep -qE '"(socks|http|shadowsocks(r)?|vmess|trojan|wireguard|hysteria(2)?|vless|shadowtls|tuic|ssh|tor|providers|anytls|soduku)"' "$core_config_new"; then echo ----------------------------------------------- logger "获取到了配置文件【$core_config_new】,但似乎并不包含正确的节点信息!" 31 echo "请尝试使用6-2或者6-3的方式生成配置文件!" exit 1 fi + #删除不兼容的旧版内容 + sed -i 's/^.*"inbounds":/{"inbounds":/' "$core_config_new" + sed -i 's/{[^{}]*"dns-out"[^{}]*}//g' "$core_config_new" #检测并去除无效策略组 [ -n "$url_type" ] && { #获得无效策略组名称 - grep -oE '\{"type":"[^"]*","tag":"[^"]*","outbounds":\["DIRECT"\]' $core_config_new | sed -n 's/.*"tag":"\([^"]*\)".*/\1/p' >"$TMPDIR"/singbox_tags + grep -oE '\{"type":"urltest","tag":"[^"]*","outbounds":\["DIRECT"\]' "$core_config_new" | sed -n 's/.*"tag":"\([^"]*\)".*/\1/p' >"$TMPDIR"/singbox_tags #删除策略组 - sed -i 's/{"type":"[^"]*","tag":"[^"]*","outbounds":\["DIRECT"\]}//g; s/{"type":"[^"]*","tag":"[^"]*","outbounds":\["DIRECT"\],"url":"[^"]*","interval":"[^"]*","tolerance":[^}]*}//g' $core_config_new + sed -i 's/{"type":"[^"]*","tag":"[^"]*","outbounds":\["DIRECT"\]}//g; s/{"type":"[^"]*","tag":"[^"]*","outbounds":\["DIRECT"\],"url":"[^"]*","interval":"[^"]*","tolerance":[^}]*}//g' "$core_config_new" #删除全部包含策略组名称的规则 while read line; do - sed -i "s/\"$line\"//g" $core_config_new + sed -i "s/\"$line\"//g" "$core_config_new" done <"$TMPDIR"/singbox_tags rm -rf "$TMPDIR"/singbox_tags - #删除多余逗号 - sed -i 's/,\+/,/g; s/\[,/\[/g; s/,]/]/g' $core_config_new } + #清理多余逗号 + sed -i 's/,\+/,/g; s/\[,/\[/g; s/,]/]/g' "$core_config_new" } get_core_config() { #下载内核配置文件 [ -z "$rule_link" ] && rule_link=1 @@ -1203,8 +1206,6 @@ EOF [ ! -s "$TMPDIR"/jsons/cust_add_rules.json ] && rm -rf "$TMPDIR"/jsons/cust_add_rules.json } #提取配置文件以获得outbounds.json,providers.json及route.json - sed -i 's/^.*"inbounds":/{"inbounds":/' $core_config #删除旧版不支持的内容 - sed -i 's/,{[^{}]*"dns-out"[^{}]*}//g' $core_config "$TMPDIR"/CrashCore format -c $core_config >"$TMPDIR"/format.json echo '{' >"$TMPDIR"/jsons/outbounds.json echo '{' >"$TMPDIR"/jsons/route.json diff --git a/scripts/webget.sh b/scripts/webget.sh index b28c2e8..c3f9cf1 100644 --- a/scripts/webget.sh +++ b/scripts/webget.sh @@ -1503,7 +1503,7 @@ setcore(){ #内核选择菜单 echo -e " 说明文档: \033[36;4mhttps://wiki.metacubex.one\033[0m" echo -e "2 \033[43;30m SingBoxR \033[0m: \033[32m支持全面\033[0m" echo -e " >>\033[32m$singbox_v \033[33m使用reF1nd增强分支\033[0m" - echo -e " 说明文档: \033[36;4mhttps://github.com/reF1nd/sing-box/tree/reF1nd-main\033[0m" + echo -e " 说明文档: \033[36;4mhttps://sing-boxr.dustinwin.us.kg/zh/\033[0m" #echo -e "4 \033[43;30m SingBoxP \033[0m: \033[32m支持ssr、providers、dns并发……\033[0m" #echo -e " >>\033[32m$singboxp_v \033[33mPuerNya分支版本\033[0m" #echo -e " 说明文档: \033[36;4mhttps://sing-boxp.dustinwin.top\033[0m"