]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
script: Attempt to fix geoip script
authorDavid Goulet <dgoulet@torproject.org>
Wed, 30 Aug 2023 12:40:44 +0000 (08:40 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Wed, 30 Aug 2023 12:40:44 +0000 (08:40 -0400)
Signed-off-by: David Goulet <dgoulet@torproject.org>
scripts/maint/geoip/update_geoip.sh

index ac0e9eb514b7d9ea52569cc836705cdaf96c7c7a..c48f4b1b4531f1c38defa15eca4ae6dfdd5bb3c7 100755 (executable)
@@ -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"