From 1294555e11916e856cb161de44ad7944c4cbf459 Mon Sep 17 00:00:00 2001 From: bolvan Date: Fri, 24 Mar 2017 08:39:13 +0300 Subject: [PATCH] regular exp fix --- ipset/get_antizapret.sh | 4 ++-- ipset/get_reestr.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ipset/get_antizapret.sh b/ipset/get_antizapret.sh index f92487d..cbede7b 100755 --- a/ipset/get_antizapret.sh +++ b/ipset/get_antizapret.sh @@ -15,10 +15,10 @@ getuser #curl --fail --max-time 300 --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]*$' \ +# | 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]+$' \ # | sort -u \ curl --fail --max-time 300 --max-filesize 33554432 -k -L "$ZURL" \ - | 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]*$' \ + | 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 ' ') diff --git a/ipset/get_reestr.sh b/ipset/get_reestr.sh index 7183747..9c2eb28 100755 --- a/ipset/get_reestr.sh +++ b/ipset/get_reestr.sh @@ -23,7 +23,7 @@ curl --fail --max-time 300 --max-filesize 20971520 "$ZURL" >$ZREESTR && { sed -nre 's/^[^;]*;([^;|\\]{4,250})\;.*/\1/p' $ZREESTR | sort | uniq >$ZDIG rm -f $ZREESTR echo digging started ... - dig A +short +time=8 +tries=2 -f $ZDIG | grep -E '^[^;].*[^.]$' | 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 || { + dig A +short +time=8 +tries=2 -f $ZDIG | grep -E '^[^;].*[^\.]$' | 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 || { rm -f $ZDIG exit 1 }