diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2015-02-03 11:13:56 -0500 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-02-03 19:42:43 -0200 |
commit | 2c0b17ad21c3cd71d85e8ee3bdbc16b4fe2cdb62 (patch) | |
tree | c46110218648992fcbed42625efc27637f831b0b /config/snort/snort_post_install.php | |
parent | 00b1e97470f8d44259409b7127510f26016e8d51 (diff) | |
download | pfsense-packages-2c0b17ad21c3cd71d85e8ee3bdbc16b4fe2cdb62.tar.gz pfsense-packages-2c0b17ad21c3cd71d85e8ee3bdbc16b4fe2cdb62.tar.bz2 pfsense-packages-2c0b17ad21c3cd71d85e8ee3bdbc16b4fe2cdb62.zip |
Fix duplicated cron task bug when saving new time interval.
Diffstat (limited to 'config/snort/snort_post_install.php')
-rw-r--r-- | config/snort/snort_post_install.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/config/snort/snort_post_install.php b/config/snort/snort_post_install.php index 57e92ce5..bbe7e3e2 100644 --- a/config/snort/snort_post_install.php +++ b/config/snort/snort_post_install.php @@ -115,6 +115,27 @@ if ($pkgid >= 0) { /* Define a default Dashboard Widget Container for Snort */ $snort_widget_container = "snort_alerts-container:col2:close"; +/*********************************************************/ +/* START OF BUG FIX CODE */ +/* */ +/* Remove any Snort cron tasks that may have been left */ +/* from a previous uninstall due to a bug that saved */ +/* edited cron tasks as new ones while still leaving */ +/* the original task. Correct cron task entries will */ +/* be recreated below if saved settings are detected. */ +/*********************************************************/ +$cron_count = 0; +while (snort_cron_job_exists("snort2c", FALSE)) { + install_cron_job("snort2c", false); + $cron_count++; +} +if ($cron_count > 0) + log_error(gettext("[Snort] Removed {$cron_count} duplicate 'remove_blocked_hosts' cron task(s).")); + +/*********************************************************/ +/* END OF BUG FIX CODE */ +/*********************************************************/ + /* remake saved settings */ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') { log_error(gettext("[Snort] Saved settings detected... rebuilding installation with saved settings...")); |