From b5f159e7b89a43ec54b3166e9dff6a794712e253 Mon Sep 17 00:00:00 2001 From: robiscool Date: Tue, 2 Jun 2009 06:31:20 -0700 Subject: cron change in snort.inc. fixed snort_download_rules.php added time stamps, last update time. keeping an eye on Snort.org for changes. --- config/snort/snort_download_rules.php | 60 +++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 14 deletions(-) (limited to 'config/snort/snort_download_rules.php') diff --git a/config/snort/snort_download_rules.php b/config/snort/snort_download_rules.php index 8d795934..668aee45 100644 --- a/config/snort/snort_download_rules.php +++ b/config/snort/snort_download_rules.php @@ -47,6 +47,7 @@ include("/usr/local/www/head.inc"); + -
@@ -91,11 +91,11 @@ if(!$pgtitle_output)
- - @@ -106,10 +106,11 @@ if(!$pgtitle_output) - + You last checked for updates: {$last_md5_download}

\n"; + echo "\n\n\n\n"; + exit(0); } /* Check if were up to date */ @@ -176,8 +198,15 @@ $md5_check_new_parse = file_get_contents("{$tmpfname}/{$snort_filename_md5}"); $md5_check_new = `/bin/echo "{$md5_check_new_parse}" | /usr/bin/awk '{ print $4 }'`; $md5_check_old_parse = file_get_contents("{$snortdir}/{$snort_filename_md5}"); $md5_check_old = `/bin/echo "{$md5_check_old_parse}" | /usr/bin/awk '{ print $4 }'`; +/* Write out time of last sucsessful md5 to cache */ +$config['installedpackages']['snort']['last_md5_download'] = date("Y-M-jS-h:i-A"); +write_config(); if ($md5_check_new == $md5_check_old) - echo "You are Up to date!\n\n\n\n", update_status(gettext("Your rules are up to date...")), update_output_window(gettext("You may start Snort now.")), hide_progress_bar_status(), exit(0); + update_status(gettext("Your rules are up to date...")); + update_output_window(gettext("You may start Snort now.")); + hide_progress_bar_status(); + echo "\n\n\n\n"; + exit(0); } /* echo "You are Not Up to date!\n"; */ @@ -189,7 +218,7 @@ if (file_exists("{$tmpfname}/{$snort_filename}")) { update_status(gettext("Snortrule tar file exists...")); } else { /* echo "downloading rules\n"; */ - update_status(gettext("Downloading rules...")); + update_status(gettext("There is a new set of Snort rules posted. Downloading...")); update_output_window(gettext("May take 4 to 10 min...")); update_output_window("{$snort_filename}"); @@ -301,3 +330,6 @@ function read_body_firmware($ch, $string) { } ?> + + + -- cgit v1.2.3