Merge branch 'next-geoip' into core-90-geoip

This commit is contained in:
Stefan Schantl
2015-04-15 17:10:49 +02:00
28 changed files with 1669 additions and 24 deletions

View File

@@ -179,6 +179,11 @@ iptables_init() {
iptables -A OUTPUT -o "${BLUE_DEV}" -j DHCPBLUEOUTPUT
fi
# GeoIP block
iptables -N GEOIPBLOCK
iptables -A INPUT -j GEOIPBLOCK
iptables -A FORWARD -j GEOIPBLOCK
# trafic from ipsecX/TUN/TAP interfaces, before "-i GREEN_DEV" accept everything
iptables -N IPSECINPUT
iptables -N IPSECFORWARD

View File

@@ -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