From 5d74aede64811b101f8e83cdedbbd400d90d02a4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 27 Sep 2006 04:44:45 +0000 Subject: Make console text friendler --- packages/snort/snort.inc | 50 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 16 deletions(-) (limited to 'packages/snort/snort.inc') diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc index 18a4bcff..45781bc8 100644 --- a/packages/snort/snort.inc +++ b/packages/snort/snort.inc @@ -302,21 +302,30 @@ function check_for_common_errors($filename) { if(!$console_mode) { update_all_status("An error occured. Scroll down to inspect it's contents."); hide_progress_bar_status(); + } else { + log_error("An error occured. Scroll down to inspect it's contents."); + echo "An error occured. Scroll down to inspect it's contents."; + } + if(!$console_mode) { + echo " +
+
+ +

 

 

 

 

 

 

 

+

 

 

 

 

 

 

 

+

 

 

 

 

 

 

 

+

 

 

 

 

 

 

 

+

The following error occured while downloading the snort rules file from snort.org:

+ {$contents} +

 

 

 

 

 

 

 

+
+
+ "; + } else { + $contents = strip_tags($contents); + log_error("Error downloading snort rules: {$contents}"); + echo "Error downloading snort rules: {$contents}"; } - echo " -
-
- -

 

 

 

 

 

 

 

-

 

 

 

 

 

 

 

-

 

 

 

 

 

 

 

-

 

 

 

 

 

 

 

-

The following error occured while downloading the snort rules file from snort.org:

- {$contents} -

 

 

 

 

 

 

 

-
-
- "; scroll_down_to_bottom_of_page(); exit; } @@ -343,6 +352,9 @@ function verify_downloaded_file($filename) { if(!$console_mode) { update_all_status("Could not fetch snort rules ({$filename}). Check oinkid key and dns and try again."); hide_progress_bar_status(); + } else { + log_error("Could not fetch snort rules ({$filename}). Check oinkid key and dns and try again."); + echo "Could not fetch snort rules ({$filename}). Check oinkid key and dns and try again."; } exit; } @@ -360,6 +372,9 @@ function extract_snort_rules_md5($tmpfname) { if(!$console_mode) { $static_output = gettext("Snort rules extracted."); update_all_status($static_output); + } else { + log_error("Snort rules extracted."); + echo "Snort rules extracted."; } } @@ -374,9 +389,12 @@ function verify_snort_rules_md5($tmpfname) { $file_md5_ondisk = `/sbin/md5 {$tmpfname}/{$snort_filename} | /usr/bin/awk '{ print $4 }'`; if($md5 <> $file_md5_ondisk) { if(!$console_mode) { - $static_output = gettext("md5 signature of rules mismatch."); + $static_output = gettext("snort rules: md5 signature of rules mismatch."); update_all_status($static_output); hide_progress_bar_status(); + } else { + log_error("snort rules: md5 signature of rules mismatch."); + echo "snort rules: md5 signature of rules mismatch."; } exit; } @@ -390,7 +408,7 @@ function hide_progress_bar_status() { } function update_all_status($status) { - global $snort_filename, $snort_filename_md5; + global $snort_filename, $snort_filename_md5, $console_mode; ob_flush(); if(!$console_mode) { update_status($status); -- cgit v1.2.3