~singbox1.13版本内核适配旧版配置文件

This commit is contained in:
juewuy
2025-11-30 22:32:39 +08:00
parent 5c9fdeddd0
commit c02e84ead2
3 changed files with 4 additions and 1 deletions

View File

@@ -95,7 +95,7 @@ ckstatus() {
#检测系统端口占用
checkport
fi
corename=$(echo $crashcore | sed 's/singbox/SingBox/' | sed 's/clash/Clash/' | sed 's/meta/Mihomo/')
corename=$(echo $crashcore | sed 's/singboxr/SingBoxR/' | sed 's/singbox/SingBox/' | sed 's/clash/Clash/' | sed 's/meta/Mihomo/')
[ "$firewall_area" = 5 ] && corename='转发'
[ -f ${TMPDIR}/debug.log -o -f ${CRASHDIR}/debug.log -a -n "$PID" ] && auto="\033[33m并处于debug状态\033[0m"
#输出状态

View File

@@ -1203,6 +1203,8 @@ 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

View File

@@ -986,6 +986,7 @@ set_core_config_link(){ #直接导入配置
echo -----------------------------------------------
echo -e "注意:\033[31m此功能不兼容“跳过证书验证”功能部分老旧\n设备可能出现x509报错导致节点不通\033[0m"
echo -e "你也可以搭配在线订阅转换网站或者自建SubStore使用"
echo "$crashcore" | grep -q 'singbox' &&echo -e "singbox内核建议使用\033[32;4mhttps://subv.jwsc.eu.org/\033[0m转换"
echo -----------------------------------------------
echo -e "\033[33m0 返回上级菜单\033[0m"
echo -----------------------------------------------