diff --git a/scripts/clash.sh b/scripts/clash.sh index a451975aa..4c6c13f7b 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -521,7 +521,7 @@ setipv6(){ echo -e " 1 ipv6内核支持: \033[36m$ipv6_support\033[0m ——用于ipv6节点及规则支持" echo -e " 2 ipv6透明代理: \033[36m$ipv6_redir\033[0m ——代理ipv6流量" echo -e " 3 ipv6-DNS解析: \033[36m$ipv6_dns\033[0m ——决定内置DNS是否返回ipv6地址" - echo -e " 4 CN-ipv6绕过内核: \033[36m$cn_ipv6_route\033[0m ——优化性能,不兼容fake-ip" + echo -e " 4 CNIP绕过内核: \033[36m$cn_ipv6_route\033[0m ——优化性能,不兼容fake-ip" echo ----------------------------------------------- read -p "请输入对应数字 > " num case $num in diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 132260eb2..757f55d0a 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -558,9 +558,10 @@ setgeo(){ echo ----------------------------------------------- echo -e " 1 由\033[32malecthw\033[0m提供的全球版GeoIP数据库(约6mb)" echo -e " 2 由\033[32mHackl0us\033[0m提供的精简版CN-IP数据库(约0.2mb)" - echo -e " 3 由\033[32m17mon\033[0m提供的CN-IP文件(需启用CN_IP绕过内核功能,约0.2mb)" + echo -e " 3 由\033[32m17mon\033[0m提供的CN-IP文件(需启用CN_IP绕过,约0.2mb)" + echo -e " 4 由\033[32mChanthMiao\033[0m提供的CN-IPV6文件(需ipv6启用CN_IP绕过,约50kb)" [ "$clashcore" = "clash.meta" ] && \ - echo -e " 4 由\033[32mLoyalsoldier\033[0m提供的GeoSite数据库(限Meta内核,约4.5mb)" + echo -e " 5 由\033[32mLoyalsoldier\033[0m提供的GeoSite数据库(限Meta内核,约4.5mb)" echo " 0 返回上级菜单" echo ----------------------------------------------- read -p "请输入对应数字 > " num @@ -583,6 +584,16 @@ setgeo(){ sleep 1 fi elif [ "$num" = '4' ]; then + if [ "$cn_ipv6_route" = "已开启" -a "$ipv6_redir" = "已开启" ]; then + geotype=china_ipv6_list.txt + geoname=cn_ipv6.txt + getgeo + else + echo ----------------------------------------------- + echo -e "\033[31m未开启ipv6下CN绕过功能,无需更新CN-IPV6文件!!\033[0m" + sleep 1 + fi + elif [ "$num" = '5' ]; then geotype=geosite.dat geoname=geosite.dat getgeo diff --git a/scripts/start.sh b/scripts/start.sh index d1ef7c3a6..05aa6d647 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -456,19 +456,19 @@ cn_ip_route(){ } } cn_ipv6_route(){ - [ ! -f $bindir/china_ipv6_list.txt ] && { - if [ -f $clashdir/china_ipv6_list.txt ];then - mv $clashdir/china_ipv6_list.txt $bindir/china_ipv6_list.txt + [ ! -f $bindir/cn_ipv6.txt ] && { + if [ -f $clashdir/cn_ipv6.txt ];then + mv $clashdir/cn_ipv6.txt $bindir/cn_ipv6.txt else logger "未找到cn_ipv6列表,正在下载!" 33 - $0 webget $bindir/china_ipv6_list.txt "$update_url/bin/china_ipv6_list.txt" - [ "$?" = "1" ] && rm -rf $bindir/china_ipv6_list.txt && logger "列表下载失败!" 31 + $0 webget $bindir/cn_ipv6.txt "$update_url/bin/china_ipv6_list.txt" + [ "$?" = "1" ] && rm -rf $bindir/cn_ipv6.txt && logger "列表下载失败!" 31 fi } - [ -f $bindir/china_ipv6_list.txt -a -z "$(echo $redir_mod|grep 'Nft')" ] && { + [ -f $bindir/cn_ipv6.txt -a -z "$(echo $redir_mod|grep 'Nft')" ] && { #ipv6 echo "create cn_ip6 hash:net family inet6 hashsize 1024 maxelem 65536" > /tmp/cn6_$USER.ipset - awk '!/^$/&&!/^#/{printf("add cn_ip6 %s'" "'\n",$0)}' $bindir/china_ipv6_list.txt >> /tmp/cn6_$USER.ipset + awk '!/^$/&&!/^#/{printf("add cn_ip6 %s'" "'\n",$0)}' $bindir/cn_ipv6.txt >> /tmp/cn6_$USER.ipset ipset -! flush cn_ip6 2>/dev/null ipset -! restore < /tmp/cn6_$USER.ipset rm -rf cn6_$USER.ipset @@ -816,8 +816,8 @@ start_nft(){ ip -6 rule add fwmark 1 table 101 2> /dev/null ip -6 route add local ::/0 dev lo table 101 2> /dev/null nft add rule inet shellclash prerouting ip6 daddr {${RESERVED_IP6}} return - [ "$dns_mod" = "redir_host" -a "$cn_ipv6_route" = "已开启" -a -f $bindir/china_ipv6_list.txt ] && { - CN_IP6=$(awk '{printf "%s, ",$1}' $bindir/china_ipv6_list.txt) + [ "$dns_mod" = "redir_host" -a "$cn_ipv6_route" = "已开启" -a -f $bindir/cn_ipv6.txt ] && { + CN_IP6=$(awk '{printf "%s, ",$1}' $bindir/cn_ipv6.txt) [ -n "$CN_IP6" ] && nft add rule inet shellclash prerouting ip6 daddr {${CN_IP6}} return } [ -n "$ipv6_wan" ] && {