mirror of
https://github.com/bol-van/zapret.git
synced 2025-04-19 13:32:58 +03:00
speed up create_ipset up to 1.5 times by sed
This commit is contained in:
parent
439d726001
commit
4668258f85
@ -14,9 +14,9 @@ do
|
|||||||
[ -f "$f" ] && {
|
[ -f "$f" ] && {
|
||||||
echo Adding to ipset $1 : $f
|
echo Adding to ipset $1 : $f
|
||||||
if [ -f "$ZIPLIST_EXCLUDE" ] ; then
|
if [ -f "$ZIPLIST_EXCLUDE" ] ; then
|
||||||
grep -vxFf $ZIPLIST_EXCLUDE "$f" | sort -u | while read ip; do echo add $1 $ip; done | ipset -! restore
|
grep -vxFf $ZIPLIST_EXCLUDE "$f" | sort -u | sed -nre "s/^(.*)$/add $1 \1/p" | ipset -! restore
|
||||||
else
|
else
|
||||||
sort -u "$f" | while read ip; do echo add $1 $ip; done | ipset -! restore
|
sort -u "$f" | sed -nre "s/^(.*)$/add $1 \1/p" | ipset -! restore
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user