]> git.ipfire.org Git - ipfire-2.x.git/blame - src/initscripts/init.d/networking/red.up/99-geoip-database
networking/red.up/99-geoip-database: Fix empty folder check.
[ipfire-2.x.git] / src / initscripts / init.d / networking / red.up / 99-geoip-database
CommitLineData
0909c0d1
SS
1#!/bin/bash
2
3# Get the GeoIP database if no one exists yet.
4
e24668f9 5DIR="/usr/share/xt_geoip/*"
0909c0d1
SS
6
7found=false
8
9# Check if the directory contains any data.
e24668f9
SS
10for i in $DIR; do
11 # Ignore "." and ".."
12 if [ -d "$i" ]; then
13 found=true
14 break
15 fi
0909c0d1
SS
16done
17
18# Download ruleset if none has been found.
19if ! ${found}; then
16bbdeb9 20 /usr/local/bin/xt_geoip_update >/dev/null 2>&1
0909c0d1
SS
21fi
22
23exit 0