From de7311d1caa2fd607290c8da74156f2c8535d1f2 Mon Sep 17 00:00:00 2001 From: bolvan Date: Mon, 7 Nov 2016 18:10:07 +0300 Subject: [PATCH] get_antizapret : filter out local ips --- ipset/get_antizapret.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ipset/get_antizapret.sh b/ipset/get_antizapret.sh index e8109b6..3d3ff8a 100755 --- a/ipset/get_antizapret.sh +++ b/ipset/get_antizapret.sh @@ -11,7 +11,11 @@ ZIPLISTTMP=/tmp/zapret-ip.txt getuser -curl --fail --max-time 60 --max-filesize 33554432 -k -L "$ZURL" | sed -nre "s/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/\1\n/gp" | sed -nre "s/^[^0-9]*([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*$/\1/p" >$ZIPLISTTMP && +curl --fail --max-time 60 --max-filesize 33554432 -k -L "$ZURL" | \ + sed -nre "s/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/\1\n/gp" | \ + sed -nre "s/^[^0-9]*([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*$/\1/p" | \ + grep -vE '^192.168.[0-9]*.[0-9]*$' | grep -vE '^127.[0-9]*.[0-9]*.[0-9]*$' | grep -vE '^10.[0-9]*.[0-9]*.[0-9]*$' \ + >$ZIPLISTTMP && { dlsize=$(wc -c "$ZIPLISTTMP" | cut -f 1 -d ' ') if test $dlsize -lt 20480; then