From f694b07c859d26b5bce83aa04ab6e4176bd531c5 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Sun, 5 Oct 2014 21:35:45 -0400 Subject: Stop progress bar text output from rules update cron task. --- config/snort/snort_check_for_rule_updates.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort_check_for_rule_updates.php b/config/snort/snort_check_for_rule_updates.php index 50a54440..5070ab23 100755 --- a/config/snort/snort_check_for_rule_updates.php +++ b/config/snort/snort_check_for_rule_updates.php @@ -213,7 +213,9 @@ function snort_download_file_url($url, $file_out) { curl_setopt($ch, CURLOPT_FILE, $fout); // NOTE: required to suppress errors from XMLRPC due to progress bar output - if ($g['snort_sync_in_progress']) + // and to prevent useless spam from rules update cron job execution. This + // prevents progress bar output during package sync and rules update cron task. + if ($g['snort_sync_in_progress'] || $pkg_interface == "console") curl_setopt($ch, CURLOPT_HEADER, false); else { curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'read_header'); @@ -784,13 +786,12 @@ if ($snortdownload == 'on' || $emergingthreats == 'on' || $snortcommunityrules = update_output_window(gettext("Please wait ... restarting Snort will take some time...")); } 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')) { - touch("{$g['varrun_path']}/snort_{$snortcfg['uuid']}.disabled"); - touch("{$g['varrun_path']}/barnyard2_{$snortcfg['uuid']}.disabled"); snort_stop($snortcfg, $if_real); sleep(2); if ($pkg_interface <> "console") { @@ -799,10 +800,9 @@ if ($snortdownload == 'on' || $emergingthreats == 'on' || $snortcommunityrules = } else snort_start($snortcfg, $if_real, TRUE); - unlink_if_exists("{$g['varrun_path']}/snort_{$snortcfg['uuid']}.disabled"); - unlink_if_exists("{$g['varrun_path']}/barnyard2_{$snortcfg['uuid']}.disabled"); } } + 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...")); log_error(gettext("[Snort] Snort has restarted with your new set of rules...")); -- cgit v1.2.3