mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
Automatically download and update GeoIP Databases.
This commit is contained in:
20
src/initscripts/init.d/networking/red.up/99-geoip-database
Normal file
20
src/initscripts/init.d/networking/red.up/99-geoip-database
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/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
|
||||
found=true
|
||||
break
|
||||
done
|
||||
|
||||
# Download ruleset if none has been found.
|
||||
if ! ${found}; then
|
||||
/us/local/bin/xt_geoip_update >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user