From 26e504fbacb47031869a7ab204bcd54e54315c15 Mon Sep 17 00:00:00 2001 From: Thomas Schaefer Date: Sun, 2 Oct 2011 19:55:56 -0400 Subject: Remove email and create user backup --- config/countryblock/countryblock.inc | 5 +++++ config/countryblock/countryblock.tmp | 5 ++++- config/countryblock/countryblock_if.tmp | 2 +- config/countryblock/help.tmp | 4 ++-- config/countryblock/settings.tmp | 2 +- config/countryblock/whitelist.tmp | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/countryblock/countryblock.inc b/config/countryblock/countryblock.inc index f67fd76f..79b223ce 100644 --- a/config/countryblock/countryblock.inc +++ b/config/countryblock/countryblock.inc @@ -114,6 +114,10 @@ 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(); } @@ -125,6 +129,7 @@ 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"); diff --git a/config/countryblock/countryblock.tmp b/config/countryblock/countryblock.tmp index 0ddb4c5f..39ee6e64 100644 --- a/config/countryblock/countryblock.tmp +++ b/config/countryblock/countryblock.tmp @@ -60,6 +60,9 @@ if (count($_POST)>0) { //mwexec("pfctl -t countryblock -T kill"); //mwexec("sed -i -e '/countryblock/d' /tmp/rules.debug"); mwexec("sh execute.sh"); + + //attempt to create a backup of countries.txt + mwexec("cp /usr/local/www/packages/countryblock/countries.txt /usr/local/www/packages/countryblock_bkup/countries.txt"); } else { @@ -118,7 +121,7 @@ else { $tab_array[2] = array("Whitelist", false, "whitelist.php"); $tab_array[3] = array("Interfaces", false, "countryblock_if.php"); $tab_array[4] = array("Help", false, "help.php"); - $tab_array[5] = array("Email", false, "email.php"); + //$tab_array[5] = array("Email", false, "email.php"); display_top_tabs($tab_array); ?> diff --git a/config/countryblock/countryblock_if.tmp b/config/countryblock/countryblock_if.tmp index 8471f075..65b80992 100644 --- a/config/countryblock/countryblock_if.tmp +++ b/config/countryblock/countryblock_if.tmp @@ -122,7 +122,7 @@ include("head.inc"); $tab_array[2] = array("Whitelist", false, "whitelist.php"); $tab_array[3] = array("Interfaces", true, "countryblock_if.php"); $tab_array[4] = array("Help", false, "help.php"); - $tab_array[5] = array("Email", false, "email.php"); + //$tab_array[5] = array("Email", false, "email.php"); display_top_tabs($tab_array); ?> diff --git a/config/countryblock/help.tmp b/config/countryblock/help.tmp index 17f30f90..2f466947 100644 --- a/config/countryblock/help.tmp +++ b/config/countryblock/help.tmp @@ -34,7 +34,7 @@ $pgtitle = "Firewall: Countryblock - Help"; $tab_array[2] = array("Whitelist", false, "whitelist.php"); $tab_array[3] = array("Interfaces", false, "countryblock_if.php"); $tab_array[4] = array("Help", true, "help.php"); - $tab_array[5] = array("Email", false, "email.php"); + //$tab_array[5] = array("Email", false, "email.php"); display_top_tabs($tab_array); ?> @@ -91,7 +91,7 @@ To run countryblock as a cron job use /usr/local/etc/rc.d/countryblock.sh
Warning! - Apply after every firewall change or state reset. Use at your own risk. ---> -Please see wiki for help +Please see wiki for help or the Forum diff --git a/config/countryblock/settings.tmp b/config/countryblock/settings.tmp index 5bbfedc3..0a067d83 100644 --- a/config/countryblock/settings.tmp +++ b/config/countryblock/settings.tmp @@ -44,7 +44,7 @@ $pgtitle = "Firewall: Countryblock - Settings"; $tab_array[2] = array("Whitelist", false, "whitelist.php"); $tab_array[3] = array("Interfaces", false, "countryblock_if.php"); $tab_array[4] = array("Help", false, "help.php"); - $tab_array[5] = array("Email", false, "email.php"); + //$tab_array[5] = array("Email", false, "email.php"); display_top_tabs($tab_array); ?> diff --git a/config/countryblock/whitelist.tmp b/config/countryblock/whitelist.tmp index 0dbed5d0..d613ee11 100644 --- a/config/countryblock/whitelist.tmp +++ b/config/countryblock/whitelist.tmp @@ -43,7 +43,7 @@ mwexec("touch countries-white.txt"); $tab_array[2] = array("Whitelist", true, "whitelist.php"); $tab_array[3] = array("Interfaces", false, "countryblock_if.php"); $tab_array[4] = array("Help", false, "help.php"); - $tab_array[5] = array("Email", false, "email.php"); + //$tab_array[5] = array("Email", false, "email.php"); display_top_tabs($tab_array); ?> -- cgit v1.2.3