From 1c722d02a740a1a252ab90200d83c1942d9e76d3 Mon Sep 17 00:00:00 2001
From: Tom Schaefer
Date: Thu, 19 Aug 2010 23:36:03 -0400
Subject: countryblock added logging and stats modified:
config/countryblock/countryblock.inc modified:
config/countryblock/countryblock.tmp modified:
config/countryblock/countryblock.xml modified:
config/countryblock/execute.sh modified: pkg_config.7.xml
modified: pkg_config.8.xml modified: pkg_config.8.xml.amd64
---
config/countryblock/countryblock.inc | 6 ++---
config/countryblock/countryblock.tmp | 48 ++++++++++++++++++++++++++++++------
config/countryblock/countryblock.xml | 36 +++++++++++++--------------
config/countryblock/execute.sh | 6 ++++-
4 files changed, 67 insertions(+), 29 deletions(-)
(limited to 'config/countryblock')
diff --git a/config/countryblock/countryblock.inc b/config/countryblock/countryblock.inc
index 1f94dff1..7cab6c1d 100644
--- a/config/countryblock/countryblock.inc
+++ b/config/countryblock/countryblock.inc
@@ -33,13 +33,13 @@
-function php_sync_package()
+function php_sync_package_cb()
{
global $config;
}
-function php_install_command()
+function php_install_command_cb()
{
global $config;
@@ -88,7 +88,7 @@ function php_install_command()
}
-function deinstall_command()
+function deinstall_command_cb()
{
conf_mount_rw();
$handle = popen("/usr/local/etc/rc.d/countryblock.sh stop", "r");
diff --git a/config/countryblock/countryblock.tmp b/config/countryblock/countryblock.tmp
index c827fc4f..a8196cdc 100644
--- a/config/countryblock/countryblock.tmp
+++ b/config/countryblock/countryblock.tmp
@@ -74,8 +74,7 @@ if (count($_POST)>0) {
$savemsg_cb = "Country Block settings have been saved/updated. ";
conf_mount_ro();
}
-?>
-
+?>
+
Firewall: Country Block
+ of 246 selected.
Block outbound?
select/unselect
+ Enable Logging?
+";
+ } else {
+ echo "";
+ }
+?>
@@ -469,9 +487,9 @@ ob_start();
$results = exec("cat countries.txt | grep AR");
ob_end_clean();
if ($results == 'AR')
- echo " Argentia";
+ echo " Argentina";
else
- echo " Argentia";
+ echo " Argentina";
ob_start();
$results = exec("cat countries.txt | grep AM");
@@ -682,9 +700,9 @@ ob_start();
$results = exec("cat countries.txt | grep BF");
ob_end_clean();
if ($results == 'BF')
- echo "Burkia Faso";
+ echo "Burkina Faso";
else
- echo "Burkia Faso";
+ echo "Burkina Faso";
ob_start();
$results = exec("cat countries.txt | grep BI");
@@ -1649,6 +1667,14 @@ ob_end_clean();
else
echo "Mongolia";
+ob_start();
+$results = exec("cat countries.txt | grep ME");
+ob_end_clean();
+ if ($results == 'ME')
+ echo "Montenegro";
+ else
+ echo "Montenegro";
+
ob_start();
$results = exec("cat countries.txt | grep MS");
ob_end_clean();
@@ -2570,6 +2596,14 @@ ob_end_clean();
echo "
";
echo $results;
echo "";
+
+ //Get IP Count
+ echo "
You are blocking ";
+ ob_start();
+ $results = exec("pfctl -T show -t countryblock |grep -v -c Z");
+ ob_end_clean();
+ echo $results;
+ echo " IPs";
?>
diff --git a/config/countryblock/countryblock.xml b/config/countryblock/countryblock.xml
index a4cffe27..68ed8797 100644
--- a/config/countryblock/countryblock.xml
+++ b/config/countryblock/countryblock.xml
@@ -41,7 +41,7 @@
Active Internet
http://forum.pfsense.org/index.php/topic,25732.0.html
Country Block Settings
- 0.1.3
+ 0.1.5
Settings
/usr/local/pkg/countryblock.inc