aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2014-10-05 21:35:45 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2014-10-05 21:35:45 -0400
commitf694b07c859d26b5bce83aa04ab6e4176bd531c5 (patch)
treeaae7f37217e479caf496eb36dcfc1a76bbf283ce
parent433d0b37bfb7cd42145ed5c93c690896fc4944fa (diff)
downloadpfsense-packages-f694b07c859d26b5bce83aa04ab6e4176bd531c5.tar.gz
pfsense-packages-f694b07c859d26b5bce83aa04ab6e4176bd531c5.tar.bz2
pfsense-packages-f694b07c859d26b5bce83aa04ab6e4176bd531c5.zip
Stop progress bar text output from rules update cron task.
-rwxr-xr-xconfig/snort/snort_check_for_rule_updates.php10
1 files changed, 5 insertions, 5 deletions
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..."));