v1.3.7-test

~增加CN_IP绕过内核功能
This commit is contained in:
juewuy 2021-06-13 19:32:43 +08:00
parent 17ab8175e1
commit 2fd2259737
2 changed files with 10 additions and 6 deletions

Binary file not shown.

View File

@ -302,14 +302,18 @@ EOF
} }
#设置路由规则 #设置路由规则
cn_ip_route(){ cn_ip_route(){
if [ ! -f $clashdir/cn_ip.txt ];then if [ ! -f $bindir/cn_ip.txt ];then
logger "未找到cn_ip列表正在下载" 33 if [ -f $clashdir/cn_ip.txt ];then
webget $clashdir/cn_ip.txt "$update_url/bin/china_ip_list.txt" mv $clashdir/cn_ip.txt $bindir/cn_ip.txt
[ "$result" != 200 ] && rm -rf $clashdir/cn_ip.txt && logger "列表下载失败,已退出!" 31 && exit 1 else
logger "未找到cn_ip列表正在下载" 33
webget $bindir/cn_ip.txt "$update_url/bin/china_ip_list.txt"
[ "$result" != 200 ] && rm -rf $bindir/cn_ip.txt && logger "列表下载失败,已退出!" 31 && exit 1
fi
fi fi
if [ -f $clashdir/cn_ip.txt ];then if [ -f $bindir/cn_ip.txt ];then
echo "create cn_ip hash:net family inet hashsize 1024 maxelem 65536" > /tmp/cn_$USER.ipset echo "create cn_ip hash:net family inet hashsize 1024 maxelem 65536" > /tmp/cn_$USER.ipset
awk '!/^$/&&!/^#/{printf("add cn_ip %s'" "'\n",$0)}' $clashdir/cn_ip.txt >> /tmp/cn_$USER.ipset awk '!/^$/&&!/^#/{printf("add cn_ip %s'" "'\n",$0)}' $bindir/cn_ip.txt >> /tmp/cn_$USER.ipset
ipset -! flush cn_ip ipset -! flush cn_ip
ipset -! restore < /tmp/cn_$USER.ipset 2>/dev/null ipset -! restore < /tmp/cn_$USER.ipset 2>/dev/null
rm -rf cn_$USER.ipset rm -rf cn_$USER.ipset