Add EXCLUDE variable

This commit is contained in:
Yifan Gao 2018-08-09 05:02:53 +08:00
parent b856edc7ff
commit ec25202912
No known key found for this signature in database
GPG Key ID: 902463AFC8C00AC1
2 changed files with 6 additions and 2 deletions

View File

@ -10,9 +10,12 @@ get_asn(){
local CONF_FILE=$1
unset PATTERN
unset COUNTRY
unset EXCLUDE
source $CONF_FILE
EXCLUDE=${EXCLUDE:-"^$"}
grep -P "${COUNTRY}\$" asnames.txt |
grep -Pi "$PATTERN" |
grep -vPi "$EXCLUDE" |
awk '{gsub(/AS/, ""); print $1 }'
}

View File

@ -1,2 +1,3 @@
PATTERN=''
COUNTRY='CN'
EXCLUDE='AS45102'