]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
scripts: Use latest geoip database instead of using location
authorDavid Goulet <dgoulet@torproject.org>
Thu, 1 Jun 2023 13:32:11 +0000 (09:32 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Thu, 1 Jun 2023 13:32:11 +0000 (09:32 -0400)
Signed-off-by: David Goulet <dgoulet@torproject.org>
scripts/maint/geoip/update_geoip.sh

index 743683ab62547e288e7be30e158921c0de12ae6a..3e6b0165197ce61e646b0a3d66d3ca7463a317e8 100755 (executable)
@@ -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)