aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2023-08-30 08:40:44 -0400
committerDavid Goulet <dgoulet@torproject.org>2023-08-30 08:40:44 -0400
commit9c79442a800abcfaf8bc9a1d1a580deeab19ad65 (patch)
treeec7fd37d9dc48700542ff8b536c5e6afad43247b /scripts
parent3aa937dd5ebce4764ee908d01fdae1e9bb4ded46 (diff)
downloadtor-9c79442a800abcfaf8bc9a1d1a580deeab19ad65.tar.gz
tor-9c79442a800abcfaf8bc9a1d1a580deeab19ad65.zip
script: Attempt to fix geoip script
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maint/geoip/update_geoip.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/maint/geoip/update_geoip.sh b/scripts/maint/geoip/update_geoip.sh
index ac0e9eb514..c48f4b1b45 100755
--- a/scripts/maint/geoip/update_geoip.sh
+++ b/scripts/maint/geoip/update_geoip.sh
@@ -8,8 +8,10 @@ TMP=$(mktemp -d)
DB_PATH="/var/lib/location/database.db"
# In case it exists as a dead symlink.
-if [ -e "$DB_PATH" ]; then
+if [ -h "$DB_PATH" ]; then
unlink "$DB_PATH"
+elif [ -e "$DB_PATH" ]; then
+ rm -f "$DB_PATH"
fi
curl -o "$DB_PATH.xz" "https://location.ipfire.org/databases/1/location.db.xz"