~修复小闪存模式内核会被重复下载的bug
~修复小闪存模式部分设备无法启用的bug ~修复部分设备Tproxy失效的bug
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user