From 2697723cf1485a070776a90d210f872770496ae9 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 1 Jun 2023 09:32:11 -0400 Subject: [PATCH] scripts: Use latest geoip database instead of using location Signed-off-by: David Goulet --- scripts/maint/geoip/update_geoip.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/maint/geoip/update_geoip.sh b/scripts/maint/geoip/update_geoip.sh index 743683ab62..3e6b016519 100755 --- a/scripts/maint/geoip/update_geoip.sh +++ b/scripts/maint/geoip/update_geoip.sh @@ -5,7 +5,15 @@ set -e DIR=$(cd "$(dirname "$0")" && pwd) TMP=$(mktemp -d) -location --quiet update +DB_PATH="/var/lib/location/database.db" + +# In case it exists as a dead symlink. +if [ -e "$DB_PATH" ]; then + unlink "$DB_PATH" +fi + +curl -o "$DB_PATH.xz" "https://location.ipfire.org/databases/1/location.db.xz" +xz -d "$DB_PATH.xz" location dump "$TMP/geoip-dump.txt" OLDDIR=$(pwd) -- 2.11.4.GIT