~优化容器体验,现在首次启动成功会自动设置自启

~简化Singbox内核dns模块语法
~优化Mihomo内核配置文件覆写,现在支持自动引入sub-rules、listeners字段
~修复因urlencode导致的在线订阅更新失败的bug
~修复部分老旧设备调用wget下载时报错的bug
This commit is contained in:
juewuy
2025-12-19 18:08:06 +08:00
parent 73a204b681
commit 50213b9364
7 changed files with 13 additions and 12 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,4 @@
meta_v=v1.19.17 meta_v=v1.19.17
singboxr_v=1.13.0-alpha.27 singboxr_v=1.13.0-alpha.27
versionsh=1.9.3beta9 versionsh=1.9.3pre1
GeoIP_v=20251205 GeoIP_v=20251205

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
version=1.9.3beta9 version=1.9.3pre1
setdir() { setdir() {
dir_avail() { dir_avail() {

View File

@@ -295,7 +295,7 @@ urlencode() {
| hexdump -v -e '/1 "%02X\n"' \ | hexdump -v -e '/1 "%02X\n"' \
| while read -r hex; do | while read -r hex; do
case "$hex" in case "$hex" in
2D|2E|5F|7E|3[0-9]|4[1-9A-F]|5[A-F]|6[1-9A-F]|7[0-9A-E]) 2D|2E|5F|7E|3[0-9]|4[1-9A-F]|5[0-9A]|6[1-9A-F]|7[0-9A-E])
printf "\\$(printf '%03o' "0x$hex")" printf "\\$(printf '%03o' "0x$hex")"
;; ;;
*) *)
@@ -558,7 +558,7 @@ EOF
fi fi
fi fi
#分割配置文件 #分割配置文件
yaml_char='proxies proxy-groups proxy-providers rules rule-providers' yaml_char='proxies proxy-groups proxy-providers rules rule-providers sub-rules listeners'
for char in $yaml_char; do for char in $yaml_char; do
sed -n "/^$char:/,/^[a-z]/ { /^[a-z]/d; p; }" $core_config >"$TMPDIR"/${char}.yaml sed -n "/^$char:/,/^[a-z]/ { /^[a-z]/d; p; }" $core_config >"$TMPDIR"/${char}.yaml
done done
@@ -830,10 +830,8 @@ EOF
"default_domain_resolver": "dns_resolver", "default_domain_resolver": "dns_resolver",
"default_mark": $routing_mark, "default_mark": $routing_mark,
"rules": [ "rules": [
{ "inbound": [ "dns-in" ], "action": "sniff", "timeout": "500ms" }, { "inbound": [ "dns-in" ], "action": "hijack-dns" },
$sniffer_set $sniffer_set
{ "protocol": "dns", "action": "hijack-dns" },
{ "inbound": [ "dns-in" ], "action": "reject" },
{ "clash_mode": "Direct" , "outbound": "DIRECT" }, { "clash_mode": "Direct" , "outbound": "DIRECT" },
{ "clash_mode": "Global" , "outbound": "GLOBAL" } { "clash_mode": "Global" , "outbound": "GLOBAL" }
] ]
@@ -2066,7 +2064,10 @@ start)
systemctl start shellcrash.service || start_error systemctl start shellcrash.service || start_error
} }
elif grep -q 's6' /proc/1/comm; then elif grep -q 's6' /proc/1/comm; then
bfstart && /command/s6-svc -u /run/service/shellcrash && afstart & bfstart && /command/s6-svc -u /run/service/shellcrash && {
[ ! -f "$CRASHDIR"/.dis_startup ] && touch /etc/s6-overlay/s6-rc.d/user/contents.d/afstart
afstart &
}
elif rc-status -r >/dev/null 2>&1; then elif rc-status -r >/dev/null 2>&1; then
rc-service shellcrash stop >/dev/null 2>&1 rc-service shellcrash stop >/dev/null 2>&1
rc-service shellcrash start rc-service shellcrash start
@@ -2170,7 +2171,7 @@ webget)
#参数【$4】代表输出显示【$5】不启用重定向 #参数【$4】代表输出显示【$5】不启用重定向
#参数【$6】代表验证证书【$7】使用自定义UA #参数【$6】代表验证证书【$7】使用自定义UA
[ -n "$7" ] && agent="--user-agent \"$7\"" [ -n "$7" ] && agent="--user-agent \"$7\""
if wget --version >/dev/null 2>&1; then if wget --help 2>&1 | grep -q 'show-progress' >/dev/null 2>&1; then
[ "$4" = "echooff" ] && progress='-q' || progress='-q --show-progress' [ "$4" = "echooff" ] && progress='-q' || progress='-q --show-progress'
[ "$5" = "rediroff" ] && redirect='--max-redirect=0' || redirect='' [ "$5" = "rediroff" ] && redirect='--max-redirect=0' || redirect=''
[ "$6" = "skipceroff" ] && certificate='' || certificate='--no-check-certificate' [ "$6" = "skipceroff" ] && certificate='' || certificate='--no-check-certificate'

View File

@@ -523,7 +523,7 @@ EOF
#调用内核测试 #调用内核测试
${CRASHDIR}/start.sh core_check && ${TMPDIR}/CrashCore merge ${TMPDIR}/config.json -C ${TMPDIR}/providers ${CRASHDIR}/start.sh core_check && ${TMPDIR}/CrashCore merge ${TMPDIR}/config.json -C ${TMPDIR}/providers
if [ "$?" = 0 ];then if [ "$?" = 0 ];then
echo -e "\033[32m配置文件生成成功\033[0m" echo -e "\033[32m配置文件生成成功如果启动超时建议更新里手动安装Singbox-srs数据库常用包\033[0m"
mkdir -p ${CRASHDIR}/jsons mkdir -p ${CRASHDIR}/jsons
mv -f ${TMPDIR}/config.json ${CRASHDIR}/jsons/config.json mv -f ${TMPDIR}/config.json ${CRASHDIR}/jsons/config.json
rm -rf ${TMPDIR}/providers rm -rf ${TMPDIR}/providers
@@ -934,7 +934,7 @@ gen_core_config_link(){ #在线生成工具
echo -e " 0 \033[31m撤销输入并返回上级菜单\033[0m" echo -e " 0 \033[31m撤销输入并返回上级菜单\033[0m"
echo "-----------------------------------------------" echo "-----------------------------------------------"
read -p "请直接输入第${i}个链接或对应数字选项 > " link read -p "请直接输入第${i}个链接或对应数字选项 > " link
link=$(echo $link | sed 's/\&/%26/g') #处理分隔符 link=$(echo $link | sed 's/\&/\\&/g') #处理分隔符
test=$(echo $link | grep "://") test=$(echo $link | grep "://")
link=`echo ${link/\#*/''}` #删除链接附带的注释内容 link=`echo ${link/\#*/''}` #删除链接附带的注释内容
link=`echo ${link/\ \(*\)/''}` #删除恶心的超链接内容 link=`echo ${link/\ \(*\)/''}` #删除恶心的超链接内容

View File

@@ -1 +1 @@
1.9.3beta9 1.9.3pre1