From 26dea537ee2ba4f97200093ba4c29627838cbee1 Mon Sep 17 00:00:00 2001 From: juewuy Date: Wed, 3 Dec 2025 20:00: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=E5=86=85=E6=A0=B8=E4=BC=9A=E8=A2=AB=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E4=B8=8B=E8=BD=BD=E7=9A=84bug=20~=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B0=8F=E9=97=AA=E5=AD=98=E6=A8=A1=E5=BC=8F=E9=83=A8=E5=88=86?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=97=A0=E6=B3=95=E5=90=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?bug=20~=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E8=AE=BE=E5=A4=87Tp?= =?UTF-8?q?roxy=E5=A4=B1=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/menu.sh | 2 +- scripts/start.sh | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/menu.sh b/scripts/menu.sh index 3a77dcb..40e5173 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -1211,7 +1211,7 @@ setboot() { #启动相关设置 if [ "$mini_clash" = "未开启" ]; then if [ "$dir_size" -gt 20480 ]; then echo -e "\033[33m您的设备空间充足(>20M),无需开启!\033[0m" - elif [ "start_old" != '已开启' -a "$(cat /proc/1/comm)" = "systemd" ]; then + elif [ "$start_old" != '已开启' -a "$(cat /proc/1/comm)" = "systemd" ]; then echo -e "\033[33m不支持systemd启动模式,请先启用保守模式!\033[0m" else [ "$BINDIR" = "$CRASHDIR" ] && BINDIR="$TMPDIR" diff --git a/scripts/start.sh b/scripts/start.sh index 739f21a..379c4ff 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -31,6 +31,7 @@ getconfig() { #读取配置及全局变量 [ -z "$dns_port" ] && dns_port=1053 [ -z "$fwmark" ] && fwmark=$redir_port routing_mark=$((fwmark + 2)) + [ -z "$table" ] && table=100 [ -z "$sniffer" ] && sniffer=已开启 #是否代理常用端口 [ -z "$common_ports" ] && common_ports=已开启 @@ -1465,7 +1466,6 @@ start_firewall() { #路由规则总入口 getlanip #获取局域网host地址 #设置策略路由 [ "$firewall_area" != 4 ] && { - [ -z "$table" ] && table=100 [ "$redir_mod" = "Tproxy模式" ] && ip route add local default dev lo table $table 2>/dev/null [ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ] && { i=1 @@ -1561,13 +1561,13 @@ stop_firewall() { #还原防火墙配置 $iptable -D INPUT -p tcp --dport $db_port -j REJECT 2>/dev/null $iptable -D INPUT -p tcp --dport $db_port -j ACCEPT 2>/dev/null #清理shellcrash自建表 - for table in shellcrash_dns shellcrash shellcrash_out shellcrash_dns_out shellcrash_vm shellcrash_vm_dns; do - $iptable -t nat -F $table 2>/dev/null - $iptable -t nat -X $table 2>/dev/null + for words in shellcrash_dns shellcrash shellcrash_out shellcrash_dns_out shellcrash_vm shellcrash_vm_dns; do + $iptable -t nat -F $words 2>/dev/null + $iptable -t nat -X $words 2>/dev/null done - for table in shellcrash_mark shellcrash_mark_out; do - $iptable -t mangle -F $table 2>/dev/null - $iptable -t mangle -X $table 2>/dev/null + for words in shellcrash_mark shellcrash_mark_out; do + $iptable -t mangle -F $words 2>/dev/null + $iptable -t mangle -X $words 2>/dev/null done } #重置ipv6规则 @@ -1606,13 +1606,13 @@ stop_firewall() { #还原防火墙配置 $ip6table -D INPUT -p tcp --dport $db_port -j REJECT 2>/dev/null $ip6table -D INPUT -p tcp --dport $db_port -j ACCEPT 2>/dev/null #清理shellcrash自建表 - for table in shellcrashv6_dns shellcrashv6 shellcrashv6_out; do - $ip6table -t nat -F $table 2>/dev/null - $ip6table -t nat -X $table 2>/dev/null + for words in shellcrashv6_dns shellcrashv6 shellcrashv6_out; do + $ip6table -t nat -F $words 2>/dev/null + $ip6table -t nat -X $words 2>/dev/null done - for table in shellcrashv6_mark shellcrashv6_mark_out; do - $ip6table -t mangle -F $table 2>/dev/null - $ip6table -t mangle -X $table 2>/dev/null + for words in shellcrashv6_mark shellcrashv6_mark_out; do + $ip6table -t mangle -F $words 2>/dev/null + $ip6table -t mangle -X $words 2>/dev/null done $ip6table -t mangle -F shellcrashv6_mark 2>/dev/null $ip6table -t mangle -X shellcrashv6_mark 2>/dev/null @@ -2044,7 +2044,7 @@ stop) PID=$(pidof CrashCore) && [ -n "$PID" ] && kill -9 $PID >/dev/null 2>&1 #清理缓存目录 rm -rf "$TMPDIR"/crash_start_time - rm -rf "$TMPDIR"/CrashCore.tar.gz + rm -rf "$TMPDIR"/CrashCore ;; restart) $0 stop