aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobiscool <robrob2626@yahoo.com>2009-12-13 16:03:01 -0800
committerrobiscool <robrob2626@yahoo.com>2009-12-13 16:03:51 -0800
commitc42ee531a6fadfcce93d83099ca2cd8611a0898f (patch)
treea5cdcb54eaf241950a58c1b4056cfb411056deed
parent6addd16429792aea3f077c8c7a4d37c11208a4e2 (diff)
downloadpfsense-packages-c42ee531a6fadfcce93d83099ca2cd8611a0898f.tar.gz
pfsense-packages-c42ee531a6fadfcce93d83099ca2cd8611a0898f.tar.bz2
pfsense-packages-c42ee531a6fadfcce93d83099ca2cd8611a0898f.zip
snort-dev, add deinstall code
-rw-r--r--config/snort-dev/snort.inc30
-rw-r--r--config/snort-dev/snort_blocked.php6
-rwxr-xr-xpkg_config.7.xml2
3 files changed, 24 insertions, 14 deletions
diff --git a/config/snort-dev/snort.inc b/config/snort-dev/snort.inc
index 12a68f23..5dfa4255 100644
--- a/config/snort-dev/snort.inc
+++ b/config/snort-dev/snort.inc
@@ -834,7 +834,8 @@ function create_snort_conf() {
conf_mount_ro();
}
-function snort_deinstall() {
+function snort_deinstall()
+{
global $config, $g, $id, $if_real;
conf_mount_rw();
@@ -863,31 +864,38 @@ function snort_deinstall() {
/* Remove snort cron entries Ugly code needs smoothness*/
- function snort_rm_blocked_deinstall_cron($should_install) {
+ function snort_rm_blocked_deinstall_cron($should_install)
+ {
global $config, $g;
$is_installed = false;
if(!$config['cron']['item'])
- return;
+ return;
$x=0;
- foreach($config['cron']['item'] as $item) {
- if (strstr($item['command'], "snort2c")) {
+ foreach($config['cron']['item'] as $item)
+ {
+ if (strstr($item['command'], "snort2c"))
+ {
$is_installed = true;
break;
}
+
$x++;
- }
- if($is_installed == true) {
- if($x > 0) {
+ }
+ if($is_installed == true)
+ {
+ if($x > 0)
+ {
unset($config['cron']['item'][$x]);
write_config();
conf_mount_rw();
- }
+ }
configure_cron();
- }
- }
+ }
+ conf_mount_ro();
+}
function snort_rules_up_deinstall_cron($should_install) {
global $config, $g;
diff --git a/config/snort-dev/snort_blocked.php b/config/snort-dev/snort_blocked.php
index ac751d2a..f4de6e0d 100644
--- a/config/snort-dev/snort_blocked.php
+++ b/config/snort-dev/snort_blocked.php
@@ -82,8 +82,9 @@ include("head.inc");
<?php
$associatealertip = $config['installedpackages']['snort']['config'][0]['associatealertip'];
- $ips = `/sbin/pfctl -t snort2c -T show`;
- $ips_array = split("\n", $ips);
+ // $ips = `/sbin/pfctl -t snort2c -T show`;
+ $ips_array = file('/usr/rob/test.log');
+ // $ips_array = split("\n", $ips);
$counter = 0;
foreach($ips_array as $ip) {
if(!$ip)
@@ -124,6 +125,7 @@ include("head.inc");
<?php
+/* tell the user what settings they have */
$blockedtab_msg_chk = $config['installedpackages']['snort']['config'][0]['rm_blocked'];
if ($blockedtab_msg_chk == "1h_b") {
$blocked_msg = "hour";
diff --git a/pkg_config.7.xml b/pkg_config.7.xml
index af212c9a..ebda8a57 100755
--- a/pkg_config.7.xml
+++ b/pkg_config.7.xml
@@ -324,7 +324,7 @@
<version>2.8.4.1_7 pkg v. 1.8</version>
<required_version>1.2.3</required_version>
<status>RC4</status>
- <configurationfile>/snort/snort.xml</configurationfile>
+ <configurationfile>/snort.xml</configurationfile>
<after_install_info>This is the Snort-dev branch and is stable as of RC3.</after_install_info>
</package>
<package>