diff --git a/data/live-build-config/hooks/live/40-init-geoip-database.chroot b/data/live-build-config/hooks/live/40-init-geoip-database.chroot index 9f939f0af2..da6d826115 100755 --- a/data/live-build-config/hooks/live/40-init-geoip-database.chroot +++ b/data/live-build-config/hooks/live/40-init-geoip-database.chroot @@ -7,13 +7,24 @@ DATE_SUFFIX=$(date +%Y-%m) URL="https://download.db-ip.com/free/dbip-country-lite-${DATE_SUFFIX}.csv.gz" OUT_PATH="/usr/share/vyos-geoip/dbip-country-lite.csv.gz" +ASN_URL="https://download.db-ip.com/free/dbip-asn-lite-${DATE_SUFFIX}.csv.gz" +ASN_OUT_PATH="/usr/share/vyos-geoip/dbip-asn-lite.csv.gz" + mkdir -p $(dirname $OUT_PATH) -wget -O - $URL > $OUT_PATH +curl -sSfL -o $OUT_PATH $URL if [ $? -ne 0 ]; then - echo "Failed to download GeoIP database" + echo "Failed to download GeoIP country-code database" rm $OUT_PATH fi +mkdir -p $(dirname $ASN_OUT_PATH) +curl -sSfL -o $ASN_OUT_PATH $ASN_URL + +if [ $? -ne 0 ]; then + echo "Failed to download GeoIP ASN database" + rm $ASN_OUT_PATH +fi + # Generate sqlite database python3 /usr/libexec/vyos/geoip-update.py --init diff --git a/data/live-build-config/rootfs/excludes b/data/live-build-config/rootfs/excludes index b824c57cd8..ac646388dd 100644 --- a/data/live-build-config/rootfs/excludes +++ b/data/live-build-config/rootfs/excludes @@ -45,6 +45,7 @@ usr/local/games/* # T5511: We do not need any caches on the system (will be recreated when needed). # T7278: We need directory created by python3-cracklib for password checks +# T7926: VyOS GeoIP database location var/cache/!(cracklib|vyos) # T5511: We do not need any log-files on the system (will be recreated when needed).