aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_post_install.php
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2014-09-17 20:49:00 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2014-09-17 20:49:00 -0400
commitd952d1ee53bae2150c789fe86ee6673eb0c6d262 (patch)
tree99f240150ab8898048155e2ce78422d76d2532c9 /config/snort/snort_post_install.php
parentf7f5c7bb21c94f6be6b36202a8fa301d86a66406 (diff)
downloadpfsense-packages-d952d1ee53bae2150c789fe86ee6673eb0c6d262.tar.gz
pfsense-packages-d952d1ee53bae2150c789fe86ee6673eb0c6d262.tar.bz2
pfsense-packages-d952d1ee53bae2150c789fe86ee6673eb0c6d262.zip
Use Snort description for service descr or friendly descr otherwise.
Diffstat (limited to 'config/snort/snort_post_install.php')
-rw-r--r--config/snort/snort_post_install.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/config/snort/snort_post_install.php b/config/snort/snort_post_install.php
index 5c47e151..ece75f2b 100644
--- a/config/snort/snort_post_install.php
+++ b/config/snort/snort_post_install.php
@@ -229,18 +229,21 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') {
$barnyard_found = FALSE;
foreach ($config['installedpackages']['service'] as $service) {
if (isset($service['uuid']) && $service['uuid'] == $snortcfg['uuid'] &&
- $service['name'] == "snort_" . strtolower(convert_friendly_interface_to_friendly_descr($snortcfg['interface']))) {
+ $service['name'] == "snort_" . strtolower($snortcfg['interface'])) {
$snort_found = TRUE;
}
if (isset($service['uuid']) && $service['uuid'] == $snortcfg['uuid'] &&
- $service['name'] == "barnyard2_" . strtolower(convert_friendly_interface_to_friendly_descr($snortcfg['interface']))) {
+ $service['name'] == "barnyard2_" . strtolower($snortcfg['interface'])) {
$barnyard_found = TRUE;
}
}
if (!$snort_found) {
$service = array();
- $service['name'] = "snort_" . strtolower(convert_friendly_interface_to_friendly_descr($snortcfg['interface']));
- $service['description'] = "Snort IDS/IPS - " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']);
+ $service['name'] = "snort_" . strtolower($snortcfg['interface']);
+ if (!empty($snortcfg['descr']))
+ $service['description'] = "Snort IDS - " . $snortcfg['descr'];
+ else
+ $service['description'] = "Snort IDS - " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']);
$service['uuid'] = $snortcfg['uuid'];
$service['startcmd'] = "\$action='start';\$service='snort';\$uuid={$snortcfg['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';";
$service['stopcmd'] = "\$action='stop';\$service='snort';\$uuid={$snortcfg['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';";
@@ -251,8 +254,11 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') {
}
if (!$barnyard_found && $snortcfg['barnyard_enable'] == 'on') {
$service = array();
- $service['name'] = "barnyard2_" . strtolower(convert_friendly_interface_to_friendly_descr($snortcfg['interface']));
- $service['description'] = "Barnyard2 Logging - " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']);
+ $service['name'] = "barnyard2_" . strtolower($snortcfg['interface']);
+ if (!empty($snortcfg['descr']))
+ $service['description'] = "Barnyard2 Logging - " . $snortcfg['descr'];
+ else
+ $service['description'] = "Barnyard2 Logging - " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']);
$service['uuid'] = $snortcfg['uuid'];
$service['startcmd'] = "\$action='start';\$service='barnyard2';\$uuid={$snortcfg['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';";
$service['stopcmd'] = "\$action='stop';\$service='barnyard2';\$uuid={$snortcfg['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';";