From 4fa9c97866c90b7bb84ff7b55579b646b53184f1 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Tue, 7 Oct 2014 16:46:48 -0400 Subject: Improve how Snort is restarted after a rules update. --- config/snort/snort_check_for_rule_updates.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/config/snort/snort_check_for_rule_updates.php b/config/snort/snort_check_for_rule_updates.php index 975644f1..e2f5997c 100755 --- a/config/snort/snort_check_for_rule_updates.php +++ b/config/snort/snort_check_for_rule_updates.php @@ -787,21 +787,8 @@ if ($snortdownload == 'on' || $emergingthreats == 'on' || $snortcommunityrules = } error_log(gettext("\tRestarting Snort to activate the new set of rules...\n"), 3, $snort_rules_upd_log); touch("{$g['varrun_path']}/snort_pkg_starting.lck"); - foreach ($config['installedpackages']['snortglobal']['rule'] as $snortcfg) { - if ($snortcfg['enable'] != "on") - continue; - $if_real = get_real_interface($snortcfg['interface']); - if (snort_is_running($snortcfg['uuid'], $if_real, 'snort')) { - snort_stop($snortcfg, $if_real); - sleep(2); - if ($pkg_interface <> "console") { - update_output_window(gettext("Starting Snort on " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']) . "...")); - snort_start($snortcfg, $if_real, FALSE); - } - else - snort_start($snortcfg, $if_real, TRUE); - } - } + snort_start_all_interfaces(TRUE); + sleep(3); unlink_if_exists("{$g['varrun_path']}/snort_pkg_starting.lck"); if ($pkg_interface <> "console") update_output_window(gettext("Snort has restarted with your new set of rules...")); -- cgit v1.2.3