mirror of
https://github.com/gaoyifan/china-operator-ip.git
synced 2025-07-13 21:02:37 +08:00
no need to convert old ASN style anymore
This commit is contained in:
parent
43a85036a2
commit
1225f6821f
11
common.sh
11
common.sh
@ -13,16 +13,7 @@ get_asn(){
|
||||
source $CONF_FILE
|
||||
grep -P "${COUNTRY}\$" asnames.txt |
|
||||
grep -Pi "$PATTERN" |
|
||||
awk '{print $1}' |
|
||||
while read ASN; do
|
||||
ASN=${ASN#AS}
|
||||
if grep '\.' <(echo $ASN) > /dev/null; then
|
||||
ASN_HIGH=${ASN%.*}
|
||||
ASN_LOW=${ASN#*.}
|
||||
ASN=$((ASN_HIGH * 65536 + ASN_LOW))
|
||||
fi
|
||||
echo $ASN
|
||||
done
|
||||
awk '{gsub(/AS/, ""); print $1 }'
|
||||
}
|
||||
|
||||
prepare_data(){
|
||||
|
Loading…
Reference in New Issue
Block a user