5 DIR
=$
(cd "$(dirname "$0")" && pwd)
8 DB_PATH
="/var/lib/location/database.db"
10 # In case it exists as a dead symlink.
11 if [ -h "$DB_PATH" ]; then
13 elif [ -e "$DB_PATH" ]; then
17 curl
-o "$DB_PATH.xz" "https://location.ipfire.org/databases/1/location.db.xz"
19 location dump
"$TMP/geoip-dump.txt"
22 cd "$DIR/geoip-db-tool/"
23 cargo build
--release --target-dir "target"
26 "$DIR/geoip-db-tool/target/release/geoip-db-tool" -i "$TMP/geoip-dump.txt"