~优化了nftables处理流程

~优化了自动下载数据库功能,现在会自动识别配置文件中是否存在相关链接,如是则不触发
~优化新手引导默认参数,现在默认启用绕过cnip功能,非mips设备默认启用混合模式
~新手引导选择局域网设备时,增加了net.bridge.bridge-nf-call-iptables禁用,以修复部分设备因docker冲突而导致代理异常的问题
This commit is contained in:
juewuy
2025-01-19 17:09:37 +08:00
parent c4e1c976af
commit db0836e9e0
2 changed files with 31 additions and 23 deletions

View File

@@ -2238,14 +2238,24 @@ userguide(){
forwhat
elif [ "$num" = 1 ];then
#设置运行模式
redir_mod="Redir模式"
redir_mod="混合模式"
[ -n "$(echo $cputype | grep -E "linux.*mips.*")" ] && {
if grep -qE '^TPROXY$' /proc/net/ip_tables_targets || modprobe xt_TPROXY >/dev/null 2>&1; then
redir_mod="Tproxy模式"
else
redir_mod="Redir模式"
fi
setconfig crashcore "clash"
}
setconfig redir_mod "$redir_mod"
[ -n "$(echo $cputype | grep -E "linux.*mips.*")" ] && setconfig crashcore "clash"
#默认启用绕过CN-IP
setconfig cn_ip_route 已开启
#自动识别IPV6
[ -n "$(ip a 2>&1 | grep -w 'inet6' | grep -E 'global' | sed 's/.*inet6.//g' | sed 's/scope.*$//g')" ] && {
setconfig ipv6_redir 已开启
setconfig ipv6_support 已开启
setconfig ipv6_dns 已开启
setconfig cn_ipv6_route 已开启
}
#设置开机启动
[ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ] && /etc/init.d/shellcrash enable
@@ -2262,6 +2272,9 @@ userguide(){
sysctl -w net.ipv4.ip_forward=1
} && echo "已成功开启ipv4转发如未正常开启请手动重启设备" || echo "开启失败!请自行谷歌查找当前设备的开启方法!"
fi
#禁止docker启用的net.bridge.bridge-nf-call-iptables
sysctl -w net.bridge.bridge-nf-call-iptables=0
sysctl -w net.bridge.bridge-nf-call-ip6tables=0
elif [ "$num" = 2 ];then
setconfig redir_mod "Redir模式"
[ -n "$(echo $cputype | grep -E "linux.*mips.*")" ] && setconfig crashcore "clash"