From de7b57330ecd8523d78babd005ebc74d7cf7b93a Mon Sep 17 00:00:00 2001 From: juewuy Date: Tue, 20 Jan 2026 21:51:57 +0800 Subject: [PATCH] =?UTF-8?q?~=E4=BF=AE=E5=A4=8D=E5=B0=8F=E9=97=AA=E5=AD=98?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=9B=B4=E6=96=B0=E5=86=85=E6=A0=B8=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84bug=20~=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E6=9C=AC=E6=9C=BA=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E8=87=B4dns=E5=A4=B1=E6=95=88=E7=9A=84bug=20~?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0Mihomo=E5=86=85=E6=A0=B8direct-nameserver?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/libs/core_tools.sh | 19 +++++++------------ scripts/starts/check_core.sh | 5 ++--- scripts/starts/clash_modify.sh | 1 + scripts/starts/fw_stop.sh | 2 +- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/scripts/libs/core_tools.sh b/scripts/libs/core_tools.sh index 536b2b00..4a830e77 100644 --- a/scripts/libs/core_tools.sh +++ b/scripts/libs/core_tools.sh @@ -40,17 +40,12 @@ core_check(){ COMMAND='"$TMPDIR/CrashCore -d $BINDIR -f $TMPDIR/config.yaml"' fi if [ -z "$v" ]; then - rm -rf "$TMPDIR"/core_new - rm -rf "$1" + rm -rf "$1" "$TMPDIR"/core_new return 2 else rm -f "$BINDIR"/CrashCore.tar.gz "$BINDIR"/CrashCore.gz "$BINDIR"/CrashCore.upx - mv -f "$TMPDIR"/core_new "$TMPDIR"/CrashCore - if [ -f "$1" ];then - mv -f "$1" "$BINDIR/CrashCore.${zip_type}" - else - gzip -c "$TMPDIR"/CrashCore > "$BINDIR"/CrashCore.gz - fi + mv -f "$TMPDIR/Coretmp.$zip_type" "$BINDIR/CrashCore.$zip_type" + mv -f "$TMPDIR/core_new" "$TMPDIR/CrashCore" core_v="$v" setconfig COMMAND "$COMMAND" "$CRASHDIR"/configs/command.env && . "$CRASHDIR"/configs/command.env setconfig crashcore "$crashcore" @@ -64,17 +59,17 @@ core_webget(){ . "$CRASHDIR"/libs/check_target.sh if [ -z "$custcorelink" ];then [ -z "$zip_type" ] && zip_type='tar.gz' - get_bin "$TMPDIR/CrashCore.${zip_type}" "bin/$crashcore/${target}-linux-${cpucore}.${zip_type}" + get_bin "$TMPDIR/Coretmp.$zip_type" "bin/$crashcore/${target}-linux-${cpucore}.$zip_type" else zip_type=$(echo "$custcorelink" | grep -oE 'tar.gz$') [ -z "$zip_type" ] && zip_type=$(echo "$custcorelink" | grep -oE 'gz$') - [ -n "$zip_type" ] && webget "$TMPDIR/CrashCore.${zip_type}" "$custcorelink" + [ -n "$zip_type" ] && webget "$TMPDIR/Coretmp.$zip_type" "$custcorelink" fi #校验内核 if [ "$?" = 0 ];then - core_check "$TMPDIR/CrashCore.${zip_type}" + core_check "$TMPDIR/Coretmp.$zip_type" else - rm -rf "$TMPDIR/CrashCore.${zip_type}" + rm -rf "$TMPDIR/Coretmp.$zip_type" return 1 fi } diff --git a/scripts/starts/check_core.sh b/scripts/starts/check_core.sh index 6bf52c44..a8815398 100644 --- a/scripts/starts/check_core.sh +++ b/scripts/starts/check_core.sh @@ -6,13 +6,12 @@ check_core() { #检查及下载内核文件 [ -n "$(find --help 2>&1 | grep -o size)" ] && find_para=' -size +2000' #find命令兼容 [ -z "$(find "$TMPDIR"/CrashCore $find_para 2>/dev/null)" ] && core_find - [ -z "$(find "$TMPDIR"/CrashCore 2>/dev/null)" ] && { + [ ! -f "$TMPDIR"/CrashCore ] && { logger "未找到【$crashcore】核心,正在下载!" 33 [ -z "$cpucore" ] && . "$CRASHDIR"/libs/check_cpucore.sh && check_cpucore [ -z "$cpucore" ] && logger 找不到设备的CPU信息,请手动指定处理器架构类型! 31 && exit 1 core_webget || logger "核心下载失败,请重新运行或更换安装源!" 31 } - [ ! -x "$TMPDIR"/CrashCore ] && chmod +x "$TMPDIR"/CrashCore 2>/dev/null #自动授权 - [ "$start_old" != "ON" -a "$(cat /proc/1/comm)" = "systemd" ] && restorecon -RF "$CRASHDIR" 2>/dev/null #修复SELinux权限问题 + [ "$start_old" != "ON" ] && [ "$(cat /proc/1/comm)" = "systemd" ] && restorecon -RF "$CRASHDIR" 2>/dev/null #修复SELinux权限问题 return 0 } diff --git a/scripts/starts/clash_modify.sh b/scripts/starts/clash_modify.sh index e08e9be1..24a91282 100644 --- a/scripts/starts/clash_modify.sh +++ b/scripts/starts/clash_modify.sh @@ -36,6 +36,7 @@ dns: use-hosts: true ipv6: $dns_v6 default-nameserver: [ $dns_resolver ] + direct-nameserver: [ $dns_nameserver ] enhanced-mode: fake-ip fake-ip-range: 28.0.0.0/8 fake-ip-range6: fc00::/16 diff --git a/scripts/starts/fw_stop.sh b/scripts/starts/fw_stop.sh index 9a6d398d..d528b7be 100644 --- a/scripts/starts/fw_stop.sh +++ b/scripts/starts/fw_stop.sh @@ -132,5 +132,5 @@ ckcmd nft && nft delete table inet shellcrash >/dev/null 2>&1 #还原防火墙文件 [ -s /etc/init.d/firewall.bak ] && mv -f /etc/init.d/firewall.bak /etc/init.d/firewall #others -[ "$systype" != 'container' ] && sed -i '/shellcrash-dns-repair/d' /etc/resolv.conf >/dev/null 2>&1 +sed -i '/shellcrash-dns-repair/d' /etc/resolv.conf 2>/dev/null