aboutsummaryrefslogtreecommitdiffstats
path: root/config/countryblock/countryblock.inc
diff options
context:
space:
mode:
Diffstat (limited to 'config/countryblock/countryblock.inc')
-rw-r--r--config/countryblock/countryblock.inc14
1 files changed, 12 insertions, 2 deletions
diff --git a/config/countryblock/countryblock.inc b/config/countryblock/countryblock.inc
index f8335d53..64c1f4cc 100644
--- a/config/countryblock/countryblock.inc
+++ b/config/countryblock/countryblock.inc
@@ -62,6 +62,9 @@ function php_install_command_cb()
//rename PHP files from .tmp to .php
+ exec("cp /tmp/countryblock_IPBlocklist.widget.tmp /usr/local/www/widgets/widgets/countryblock_IPBlocklist.widget.php");
+ unlink_if_exists("/tmp/countryblock_IPBlocklist.widget.tmp");
+
exec("cp /tmp/class.phpmailer.tmp /usr/local/www/packages/countryblock/class.phpmailer.php");
unlink_if_exists("/tmp/class.phpmailer.tmp ");
exec("cp /tmp/class.smtp.tmp /usr/local/www/packages/countryblock/class.smtp.php");
@@ -103,8 +106,10 @@ 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.php /usr/local/www/packages/countryblock/CIDR.tar.gz");
- unlink_if_exists("/tmp/CIDR.php");
+ exec("/usr/bin/fetch -o /tmp https://raw.github.com/tommyboy180/pfsense-bin/2812cb9e1c9357bbf2027eff82096773bc4ddc5d/countryblock/CIDR.tar.gz");
+
+ 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");
@@ -112,6 +117,9 @@ function php_install_command_cb()
exec("mkdir /usr/local/www/packages/countryblock/lists");
exec("touch /usr/local/www/packages/countryblock/lists/countries.txt");
+ //Attempt to restore from backup
+ exec("mkdir /usr/local/www/packages/countryblock_bkup");
+ exec("cp /usr/local/www/packages/countryblock_bkup/countries.txt /usr/local/www/packages/countryblock/countries.txt");
conf_mount_ro();
config_unlock();
@@ -124,9 +132,11 @@ function deinstall_command_cb()
$handle = popen("/usr/local/etc/rc.d/countryblock.sh stop", "r");
unlink_if_exists("/usr/local/pkg/countryblock.xml");
unlink_if_exists("/usr/local/pkg/countryblock.inc");
+ //unlink_if_exists("/usr/local/pkg/pf/countryblock.sh");
exec("rm -R /usr/local/www/packages/countryblock/countryblocks");
exec("rm -R /usr/local/www/packages/countryblock");
exec("rm /usr/local/etc/rc.d/countryblock.sh");
+ exec("rm /usr/local/pkg/pf/countryblock.sh");
exec("pfctl -t countryblock -T kill");
exec("sed -i -e '/countryblock/d' /tmp/rules.debug");
exec("pfctl -o basic -f /tmp/rules.debug");