aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort.inc
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2015-02-03 11:13:56 -0500
committerRenato Botelho <garga@FreeBSD.org>2015-02-03 19:42:43 -0200
commit2c0b17ad21c3cd71d85e8ee3bdbc16b4fe2cdb62 (patch)
treec46110218648992fcbed42625efc27637f831b0b /config/snort/snort.inc
parent00b1e97470f8d44259409b7127510f26016e8d51 (diff)
downloadpfsense-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.inc')
-rwxr-xr-xconfig/snort/snort.inc13
1 files changed, 10 insertions, 3 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc
index bec163d7..16574e77 100755
--- a/config/snort/snort.inc
+++ b/config/snort/snort.inc
@@ -814,7 +814,9 @@ function snort_snortloglimit_install_cron($should_install=TRUE) {
if ($should_install && snort_cron_job_exists("/usr/local/pkg/snort/snort_check_cron_misc.inc", TRUE, "*/5"))
return;
- // Else install the new or updated cron job
+ // Else install the new or updated cron job by removing the
+ // existing job first, then installing the new or updated job.
+ install_cron_job("snort_check_cron_misc.inc", false);
install_cron_job("/usr/bin/nice -n20 /usr/local/bin/php -f /usr/local/pkg/snort/snort_check_cron_misc.inc", $should_install, "*/5");
}
@@ -921,7 +923,9 @@ function snort_rm_blocked_install_cron($should_install) {
// Else install the new or updated cron job
if ($should_install) {
- install_cron_job($command, $should_install, $snort_rm_blocked_min, $snort_rm_blocked_hr, $snort_rm_blocked_mday, $snort_rm_blocked_month, $snort_rm_blocked_wday, "root");
+ // Remove the existing job first, then install the new or updated job
+ install_cron_job("snort2c", false);
+ install_cron_job($command, true, $snort_rm_blocked_min, $snort_rm_blocked_hr, $snort_rm_blocked_mday, $snort_rm_blocked_month, $snort_rm_blocked_wday, "root");
}
}
@@ -1009,8 +1013,11 @@ function snort_rules_up_install_cron($should_install) {
return;
// Else install the new or updated cron job
- if ($should_install)
+ if ($should_install) {
+ // Remove the existing job first, then install the new or updated job
+ install_cron_job("snort_check_for_rule_updates.php", false);
install_cron_job($command, $should_install, $snort_rules_up_min, $snort_rules_up_hr, $snort_rules_up_mday, $snort_rules_up_month, $snort_rules_up_wday, "root");
+ }
}
/* Only run when all ifaces needed to sync. Expects filesystem rw */