From 83889b4292335641f9860e25ae4e58a3bf5f6d7c Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 15 Jan 2009 05:25:44 +0000 Subject: Snort package fix snort.sh start up script so that snort will start after reboot. Sponsored by username: miteltec --- packages/snort/snort.inc | 51 ++++++++++++++++++++++-------------------------- packages/snort/snort.xml | 2 +- 2 files changed, 24 insertions(+), 29 deletions(-) (limited to 'packages') diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc index 0ae5460c..a8b16681 100644 --- a/packages/snort/snort.inc +++ b/packages/snort/snort.inc @@ -82,38 +82,33 @@ function sync_package_snort() exec("/bin/rm -f /usr/local/etc/rc.d/snort"); $first = 0; - $snortInterfaces = array(); /* -gtm */ - - /* generate if list */ - $iflist = array("lan" => "LAN"); - - for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) - $iflist['opt' . $i] = "opt{$i}"; - - if($_POST['iface_array']) - { - foreach($_POST['iface_array'] as $iface) - { + $snortInterfaces = array(); /* -gtm */ + + $if_list = $config['installedpackages']['snort']['config'][0]['iface_array']; + $if_array = split(',', $if_list); + //print_r($if_array); + if($if_array) { + foreach($if_array as $iface) { $if = convert_friendly_interface_to_real_interface_name($iface); - - if($config['interfaces'][$iface]['ipaddr'] == "pppoe") + + if($config['interfaces'][$iface]['ipaddr'] == "pppoe") { $if = "ng0"; - - /* build a list of user specified interfaces -gtm */ - if($if) - { - array_push($snortInterfaces, $if); - $first = 1; - } + } + + /* build a list of user specified interfaces -gtm */ + if($if){ + array_push($snortInterfaces, $if); + $first = 1; + } } - - if (count($snortInterfaces) < 1) - { - log_error("Snort will not start. You must select an interface for it to listen on."); - return; - } - + + if (count($snortInterfaces) < 1) { + //log_error("Snort will not start. You must select an interface for it to listen on."); + echo "Snort will not start. You must select an interface for it to listen on."; + return; + } } + //print_r($snortInterfaces); /* create log directory */ $start = "/bin/mkdir -p /var/log/snort"; diff --git a/packages/snort/snort.xml b/packages/snort/snort.xml index 9fc85c4b..6ba362c0 100644 --- a/packages/snort/snort.xml +++ b/packages/snort/snort.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. Snort - 2.8.2.1 + 2.8.2.2 Services: Snort /usr/local/pkg/snort.inc -- cgit v1.2.3