]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/networking/red.up/99-geoip-database
Move network initscripts to src/initscripts/networking
[ipfire-2.x.git] / src / initscripts / networking / red.up / 99-geoip-database
diff --git a/src/initscripts/networking/red.up/99-geoip-database b/src/initscripts/networking/red.up/99-geoip-database
new file mode 100644 (file)
index 0000000..335006a
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# Get the GeoIP database if no one exists yet.
+
+DIR="/usr/share/xt_geoip/*"
+
+found=false
+
+# Check if the directory contains any data.
+for i in $DIR; do
+       # Ignore "." and ".."
+       if [ -d "$i" ]; then
+               found=true
+               break
+       fi
+done
+
+# Download ruleset if none has been found.
+if ! ${found}; then
+       /usr/local/bin/xt_geoip_update >/dev/null 2>&1 &
+fi
+
+exit 0