]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
networking/red.up/99-geoip-database: Fix empty folder check.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 7 Mar 2015 21:39:32 +0000 (22:39 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 15 Mar 2015 10:40:31 +0000 (11:40 +0100)
src/initscripts/init.d/networking/red.up/99-geoip-database

index c79eda15d5419803085fd26d6d80d041ea5da057..4bd3ee2ab74e59972e6d62c115a9a57617282a7e 100644 (file)
@@ -2,14 +2,17 @@
 
 # Get the GeoIP database if no one exists yet.
 
-DIR=/usr/share/xt_geoip
+DIR="/usr/share/xt_geoip/*"
 
 found=false
 
 # Check if the directory contains any data.
-for i in $DIR/*; do
-        found=true
-        break
+for i in $DIR; do
+       # Ignore "." and ".."
+       if [ -d "$i" ]; then
+               found=true
+               break
+       fi
 done
 
 # Download ruleset if none has been found.