diff options
author | Tom Schaefer <tom@tomschaefer.org> | 2011-01-31 13:39:26 -0500 |
---|---|---|
committer | Tom Schaefer <tom@tomschaefer.org> | 2011-01-31 13:41:37 -0500 |
commit | 7c61cec6833ae3c9dcb6a8105ef75af35a785016 (patch) | |
tree | db4c15f8748b4be5d4aa8a13463cbba85e67249b /config/countryblock/countryblock.inc | |
parent | 686faeab1a7aac13e992b4b3d9d3bd2d4ea727dd (diff) | |
download | pfsense-packages-7c61cec6833ae3c9dcb6a8105ef75af35a785016.tar.gz pfsense-packages-7c61cec6833ae3c9dcb6a8105ef75af35a785016.tar.bz2 pfsense-packages-7c61cec6833ae3c9dcb6a8105ef75af35a785016.zip |
Update to be independant of countryipblocks site to relieve bandwidth
Diffstat (limited to 'config/countryblock/countryblock.inc')
-rw-r--r-- | config/countryblock/countryblock.inc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/config/countryblock/countryblock.inc b/config/countryblock/countryblock.inc index 902bcad5..25077311 100644 --- a/config/countryblock/countryblock.inc +++ b/config/countryblock/countryblock.inc @@ -4,7 +4,7 @@ /* ========================================================================== */ /* countryblock.inc - Copyright (C) 2010 Tom Schaefer + Copyright (C) 2011 Tom Schaefer All rights reserved. */ /* ========================================================================== */ @@ -54,6 +54,11 @@ function php_install_command_cb() exec("mkdir /usr/local/www/packages/countryblock/"); } + if (!is_dir('/usr/local/www/packages/countryblock/CIDR')) { + exec("mkdir /usr/local/www/packages/countryblock/CIDR"); + } + + //rename PHP files from .tmp to .php @@ -97,7 +102,15 @@ function php_install_command_cb() exec("cp /tmp/interfaces.txt /usr/local/www/packages/countryblock/interfaces.txt"); unlink_if_exists("/tmp/interfaces.txt"); + exec("cp /tmp/CIDR.tar.gz /usr/local/www/packages/countryblock/CIDR.tar.gz"); + unlink_if_exists("/tmp/CIDR.tar.gz"); + exec("tar xzf /usr/local/www/packages/countryblock/CIDR.tar.gz -C /usr/local/www/packages/countryblock/CIDR"); + exec("rm /usr/local/www/packages/countryblock/CIDR.tar.gz"); + + exec("mkdir /usr/local/www/packages/countryblock/lists"); + exec("touch /usr/local/www/packages/countryblock/lists/countries.txt"); + conf_mount_ro(); config_unlock(); |