From 46d3a4cb16ea09393fa141f56478e7d1d247b67c Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Thu, 16 Apr 2015 20:37:00 +0200 Subject: [PATCH] Core90: Add GeoIP to update. --- config/rootfiles/core/90/exclude | 4 +++- config/rootfiles/core/90/filelists/files | 12 ++++++++++++ .../rootfiles/core/90/filelists/perl-Text-CSV_XS | 1 + .../rootfiles/core/90/filelists/xtables-addons | 1 + config/rootfiles/core/90/update.sh | 16 ++++++++++++++++ 5 files changed, 33 insertions(+), 1 deletion(-) create mode 120000 config/rootfiles/core/90/filelists/perl-Text-CSV_XS create mode 120000 config/rootfiles/core/90/filelists/xtables-addons diff --git a/config/rootfiles/core/90/exclude b/config/rootfiles/core/90/exclude index 5be5371aaf..56e840d8cc 100644 --- a/config/rootfiles/core/90/exclude +++ b/config/rootfiles/core/90/exclude @@ -17,10 +17,12 @@ etc/sysconfig/modules etc/sysconfig/rc.local etc/udev/rules.d/30-persistent-network.rules srv/web/ipfire/html/proxy.pac -var/ipfire/time +var/ipfire/firewall/geoipblock +var/ipfire/fwhosts/custmgeoipgrp var/ipfire/ovpn/ccd.conf var/ipfire/ovpn/ccdroute var/ipfire/ovpn/ccdroute2 +var/ipfire/time var/log/cache var/state/dhcp/dhcpd.leases var/updatecache diff --git a/config/rootfiles/core/90/filelists/files b/config/rootfiles/core/90/filelists/files index 2ef5ded31f..5f05eb549e 100644 --- a/config/rootfiles/core/90/filelists/files +++ b/config/rootfiles/core/90/filelists/files @@ -1,7 +1,19 @@ etc/system-release etc/issue +etc/rc.d/init.d/firewall etc/rc.d/init.d/network-trigger +etc/rc.d/init.d/networking/red.up/99-geoip-database etc/rc.d/rcsysinit.d/S90network-trigger +srv/web/ipfire/cgi-bin/firewall.cgi +srv/web/ipfire/cgi-bin/fwhosts.cgi +srv/web/ipfire/cgi-bin/geoip-block.cgi +usr/lib/firewall/firewall-lib.pl usr/lib/firewall/rules.pl +usr/local/bin/xt_geoip_build +usr/local/bin/xt_geoip_update +var/ipfire/general-functions.pl +var/ipfire/geoip-functions.pl +var/ipfire/header.pl var/ipfire/backup/include var/ipfire/langs +var/ipfire/menu.d/50-firewall.menu diff --git a/config/rootfiles/core/90/filelists/perl-Text-CSV_XS b/config/rootfiles/core/90/filelists/perl-Text-CSV_XS new file mode 120000 index 0000000000..ec1202f07b --- /dev/null +++ b/config/rootfiles/core/90/filelists/perl-Text-CSV_XS @@ -0,0 +1 @@ +../../../common/perl-Text-CSV_XS \ No newline at end of file diff --git a/config/rootfiles/core/90/filelists/xtables-addons b/config/rootfiles/core/90/filelists/xtables-addons new file mode 120000 index 0000000000..2e24c4298b --- /dev/null +++ b/config/rootfiles/core/90/filelists/xtables-addons @@ -0,0 +1 @@ +../../../common/xtables-addons \ No newline at end of file diff --git a/config/rootfiles/core/90/update.sh b/config/rootfiles/core/90/update.sh index 6af052c0be..9a83ac403f 100644 --- a/config/rootfiles/core/90/update.sh +++ b/config/rootfiles/core/90/update.sh @@ -159,6 +159,22 @@ if [ $BOOTSPACE -lt 1000 ]; then esac fi +# Create GeoIP related files if they do not exist yet. +if [ ! -e "/var/ipfire/firewall/geoipblock" ]; then + touch /var/ipfire/firewall/geoipblock + chown nobody:nobody /var/ipfire/firewall/geoipblock + + # Insert default value into file. + echo "GEOIPBLOCK_ENABLED=off" >> /var/ipfire/firewall/geoipblock +fi +if [ ! -e "/var/ipfire/fwhosts/customgeoipgrp" ]; then + touch /var/ipfire/fwhosts/customgeoipgrp + chown nobody:nobody /var/ipfire/fwhosts/customgeoipgrp +fi + +# Download/Update GeoIP databases. +/usr/local/bin/xt_geoip_update + # Update Language cache perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang" -- 2.39.2