From 40cace16a452cd841a6b3626c44ff0d0b655956f Mon Sep 17 00:00:00 2001
From: Ermal
Date: Mon, 9 Jul 2012 09:35:24 +0000
Subject: s//usr/local/etc/snort/snortdir/ to unify its reference and location.
Trim some unused functions in the way
---
config/snort/snort_rulesets.php | 41 +++++++++--------------------------------
1 file changed, 9 insertions(+), 32 deletions(-)
(limited to 'config/snort/snort_rulesets.php')
diff --git a/config/snort/snort_rulesets.php b/config/snort/snort_rulesets.php
index 313daea2..ee700a88 100644
--- a/config/snort/snort_rulesets.php
+++ b/config/snort/snort_rulesets.php
@@ -33,7 +33,7 @@ require_once("guiconfig.inc");
require_once("/usr/local/pkg/snort/snort_gui.inc");
require_once("/usr/local/pkg/snort/snort.inc");
-global $g;
+global $g, $snortdir;
if (!is_array($config['installedpackages']['snortglobal']['rule'])) {
$config['installedpackages']['snortglobal']['rule'] = array();
@@ -64,9 +64,9 @@ $pgtitle = "Snort: Interface $id $iface_uuid $if_real Categories";
/* Check if the rules dir is empy if so warn the user */
/* TODO give the user the option to delete the installed rules rules */
-$isrulesfolderempty = exec("ls -A /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/*.rules");
+$isrulesfolderempty = exec("ls -A {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules/*.rules");
if ($isrulesfolderempty == "") {
- $isrulesfolderempty = exec("ls -A /usr/local/etc/snort/rules/*.rules");
+ $isrulesfolderempty = exec("ls -A {$snortdir}/rules/*.rules");
if ($isrulesfolderempty == "") {
include_once("head.inc");
include("fbegin.inc");
@@ -105,7 +105,7 @@ if ($isrulesfolderempty == "") {
\n
\n
\n
- # The rules directory is empty. /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules \n
+ # The rules directory is empty. {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules \n
\n
\n
\n
@@ -127,7 +127,7 @@ if ($isrulesfolderempty == "") {
exit(0);
} else {
/* Make sure that we have the rules */
- mwexec("/bin/cp /usr/local/etc/snort/rules/*.rules /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules", true);
+ mwexec("/bin/cp {$snortdir}/rules/*.rules {$snortdir}/snort_{$iface_uuid}_{$if_real}/rules", true);
}
}
@@ -167,19 +167,7 @@ include_once("head.inc");
' . $pgtitle . '