diff --git a/common.sh b/common.sh index 47bcbf48..394b26ea 100755 --- a/common.sh +++ b/common.sh @@ -10,9 +10,12 @@ get_asn(){ local CONF_FILE=$1 unset PATTERN unset COUNTRY + unset EXCLUDE source $CONF_FILE - grep -P "${COUNTRY}\$" asnames.txt | - grep -Pi "$PATTERN" | + EXCLUDE=${EXCLUDE:-"^$"} + grep -P "${COUNTRY}\$" asnames.txt | + grep -Pi "$PATTERN" | + grep -vPi "$EXCLUDE" | awk '{gsub(/AS/, ""); print $1 }' } diff --git a/operator/china.conf b/operator/china.conf index f923ecbb..e1c3521d 100644 --- a/operator/china.conf +++ b/operator/china.conf @@ -1,2 +1,3 @@ PATTERN='' COUNTRY='CN' +EXCLUDE='AS45102'