mirror of
https://github.com/gaoyifan/china-operator-ip.git
synced 2025-12-16 06:13:15 +08:00
no need to convert old ASN style anymore
This commit is contained in:
11
common.sh
11
common.sh
@@ -13,16 +13,7 @@ get_asn(){
|
|||||||
source $CONF_FILE
|
source $CONF_FILE
|
||||||
grep -P "${COUNTRY}\$" asnames.txt |
|
grep -P "${COUNTRY}\$" asnames.txt |
|
||||||
grep -Pi "$PATTERN" |
|
grep -Pi "$PATTERN" |
|
||||||
awk '{print $1}' |
|
awk '{gsub(/AS/, ""); 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare_data(){
|
prepare_data(){
|
||||||
|
|||||||
Reference in New Issue
Block a user