From 9a903edc41c8caebfae64243f809633ef070b223 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Wed, 30 Apr 2014 15:26:43 -0400 Subject: Better fix for preventing multiple rm_blocked cron entries. --- config/snort/snort.inc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 677b387e..c0c5756c 100755 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -755,17 +755,8 @@ function snort_rm_blocked_install_cron($should_install) { $snort_rm_blocked_expire = "2419200"; } - // First remove any existing "expiretable" jobs for Snort. We - // have to remove them because otherwise install_cron_job() will - // think we are installing a different job if the 'expire seconds' - // parameter differs from the old one when we call the function. - $result = array(); - $result = preg_grep('/expiretable\b\s*-t\s*(\d+)\s*snort2c\b/i', file('/etc/crontab')); - if (count($result) > 0) { - foreach($result as $job) { - install_cron_job(trim(substr($job, strpos($job, "/usr/bin/nice"))), FALSE); - } - } + // First remove any existing "expiretable" jobs for Snort. + install_cron_job("snort2c", false); // Now either install the new or updated cron job, // or return if "rm_blocked" is disabled -- cgit v1.2.3