summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-06-18 16:21:31 +0200
committerGitHub <noreply@github.com>2026-06-18 16:21:31 +0200
commitbd827e7b8d12c82ed6a9455c22d8f9cc0c280f33 (patch)
tree5d2b45e207531b9ef119f84bec6febec19c78f0b /data
parentb871f49bfd0b643f5aadc88fef79b1dc6de60c0a (diff)
parentea19696ae03d3aaeb145c0ac3fcfa6d4fafe2df2 (diff)
downloadvyos-build-bd827e7b8d12c82ed6a9455c22d8f9cc0c280f33.tar.gz
vyos-build-bd827e7b8d12c82ed6a9455c22d8f9cc0c280f33.zip
Merge pull request #1215 from sarthurdev/geoip
geoip: T5746: Download ASN database
Diffstat (limited to 'data')
-rwxr-xr-xdata/live-build-config/hooks/live/40-init-geoip-database.chroot15
-rw-r--r--data/live-build-config/rootfs/excludes1
2 files changed, 14 insertions, 2 deletions
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 9f939f0a..da6d8261 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 b824c57c..ac646388 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).