Files
2023-08-18 20:02:12 +03:00

24 lines
796 B
Bash
Executable File

#!/bin/sh
# Retrieve the latest ASN database from github
# curl https://raw.githubusercontent.com/ipverse/asn-ip/master/as/1234/ipv4-aggregated.txt
# Set the path to the directory where the ASN database will be stored to script_dir
script_dir=$(dirname "$0")
cd $script_dir
curl https://raw.githubusercontent.com/ipverse/asn-info/master/as.csv > as-info.csv
if [ $? -eq 0 ]; then
echo "ASN-Info database updated successfully"
else
echo "ASN-Info database update failed"
fi
# https://iptoasn.com/
# https://iptoasn.com/data/ip2asn-v4.tsv.gz
curl https://iptoasn.com/data/ip2asn-v4.tsv.gz | gunzip > ip2asn-v4.tsv
if [ $? -eq 0 ]; then
echo "ASN database updated successfully"
else
echo "ASN database update failed"
fi
#range_start range_end AS_number country_code AS_description