由于内核版本的限制,不能升级到ipset 到6.x版本,想批量加载IP段,原来写的一个脚本:
#!/bin/sh
# Copyright (C) 2015
OpenWrt.org _input=/jffs/chnroute.txt
IPS=/usr/sbin/ipset
ipset -N gfwlist nethash
egrep -v "^#|^$" $_input | while IFS= read -r ip
do
$IPS -A gfwlist $ip
done
循环加载感觉效率太低了,有没有好的办法来批量加载呢?
使用环境:Tomato shibby