~适配部分网件NETGEAR固件设备
~修复部分情况下测试菜单查看防火墙规则时ipv6规则显示缺失的问题
This commit is contained in:
juewuy 2023-05-03 16:59:03 +08:00
parent 49adefd1d2
commit f2047239de
6 changed files with 15 additions and 8 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2,5 +2,5 @@ clashnet_v=v1.7.6
clashpre_v=2022.11.25
clash_v=v1.7.1
meta_v=v1.14.4
versionsh=1.7.6c
GeoIP_v=20230429
versionsh=1.7.7

View File

@ -135,6 +135,7 @@ if [ -n "$systype" ];then
exit 1 ;;
esac
}
[ "$systype" = "ng_snapshot" ] && dir=/tmp/mnt
else
$echo " 1 在\033[32m/etc目录\033[0m下安装(适合root用户)"
$echo " 2 在\033[32m/usr/share目录\033[0m下安装(适合Linux系统)"
@ -198,6 +199,8 @@ echo -----------------------------------------------
[ -d "/jffs/scripts" ] && initdir='/jffs/scripts/nat-start'
}
[ -f "/data/etc/crontabs/root" ] && systype=mi_snapshot #小米设备
[ -w "/var/mnt/cfg/firewall" ] && systype=ng_snapshot #NETGEAR设备
#检查root权限
if [ "$USER" != "root" -a -z "$systype" ];then
echo 当前用户:$USER

View File

@ -1166,16 +1166,18 @@ testcommand(){
iptables -t nat -L OUTPUT --line-numbers
iptables -t nat -L clash_out --line-numbers
}
[ -n "$(echo $redir_mod | grep -E 'Tproxy模式|混合模式|Tun模式')" -a "$ipv6_redir" = "已开启" ] && {
echo ----------------Tun/Tproxy-------------------
ip6tables -t mangle -L PREROUTING --line-numbers
ip6tables -t mangle -L clashv6 --line-numbers
[ "$ipv6_redir" = "已开启" ] && {
[ -n "$(lsmod | grep 'ip6table_nat')" ] && {
echo -------------------Redir---------------------
ip6tables -t nat -L PREROUTING --line-numbers
ip6tables -t nat -L clashv6_dns --line-numbers
ip6tables -t nat -L clashv6 --line-numbers
}
[ -n "$(echo $redir_mod | grep -E 'Tproxy模式|混合模式|Tun模式')" ] && {
echo ----------------Tun/Tproxy-------------------
ip6tables -t mangle -L PREROUTING --line-numbers
ip6tables -t mangle -L clashv6 --line-numbers
}
}
fi
exit;

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (C) Juewuy
version=1.7.6c
version=1.7.7
setdir(){
dir_avail(){
@ -74,6 +74,7 @@ if [ -n "$systype" ];then
exit 1 ;;
esac
}
[ "$systype" = "ng_snapshot" ] && dir=/tmp/mnt
else
echo -e "\033[33m安装ShellClash至少需要预留约1MB的磁盘空间\033[0m"
echo -e " 1 在\033[32m/etc目录\033[0m下安装(适合root用户)"
@ -139,6 +140,7 @@ $clashdir/start.sh stop 2>/dev/null #防止进程冲突
[ -d "/jffs/scripts" ] && initdir='/jffs/scripts/nat-start'
}
[ -f "/data/etc/crontabs/root" ] && systype=mi_snapshot #小米设备
[ -w "/var/mnt/cfg/firewall" ] && systype=ng_snapshot #NETGEAR设备
#检查环境变量
[ -z "$clashdir" -a -d /tmp/SC_tmp ] && {
@ -206,8 +208,8 @@ fi
chmod a+rx $initdir 2>/dev/null
setconfig initdir $initdir
}
#小米镜像化OpenWrt额外设置
if [ "$systype" = "mi_snapshot" ];then
#镜像化OpenWrt(snapshot)额外设置
if [ "$systype" = "mi_snapshot" -o "$systype" = "ng_snapshot" ];then
chmod 755 $clashdir/misnap_init.sh
uci set firewall.ShellClash=include
uci set firewall.ShellClash.type='script'