aboutsummaryrefslogtreecommitdiffstats
path: root/config/suricata/suricata.inc
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2014-04-30 16:14:29 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2014-04-30 16:14:29 -0400
commitf15023b3676134fe19fd67bcaa97d9d243698f5a (patch)
tree7ad8c658e44f250ca1e00a27f2da6b5a61de6c3d /config/suricata/suricata.inc
parente92e5316b6452be27f6e4d6a10629562fbe160ee (diff)
downloadpfsense-packages-f15023b3676134fe19fd67bcaa97d9d243698f5a.tar.gz
pfsense-packages-f15023b3676134fe19fd67bcaa97d9d243698f5a.tar.bz2
pfsense-packages-f15023b3676134fe19fd67bcaa97d9d243698f5a.zip
Fix bug in cron task edit for 'rm_blocked' hosts
Diffstat (limited to 'config/suricata/suricata.inc')
-rw-r--r--config/suricata/suricata.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/config/suricata/suricata.inc b/config/suricata/suricata.inc
index a2be802a..53dc678f 100644
--- a/config/suricata/suricata.inc
+++ b/config/suricata/suricata.inc
@@ -589,8 +589,15 @@ function suricata_rm_blocked_install_cron($should_install) {
$suricata_rm_blocked_expire = "2419200";
}
- $command = "/usr/bin/nice -n20 /sbin/pfctl -t {$suri_pf_table} -T expire {$suricata_rm_blocked_expire}";
- install_cron_job($command, $should_install, $suricata_rm_blocked_min, $suricata_rm_blocked_hr, $suricata_rm_blocked_mday, $suricata_rm_blocked_month, $suricata_rm_blocked_wday, "root");
+ // First, remove any existing cron task for "rm_blocked" hosts
+ install_cron_job("pfctl -t {$suri_pf_table} -T expire" , false);
+
+ // Now add or update the cron task for "rm_blocked" hosts
+ // if enabled.
+ if ($should_install) {
+ $command = "/usr/bin/nice -n20 /sbin/pfctl -t {$suri_pf_table} -T expire {$suricata_rm_blocked_expire}";
+ install_cron_job($command, $should_install, $suricata_rm_blocked_min, $suricata_rm_blocked_hr, $suricata_rm_blocked_mday, $suricata_rm_blocked_month, $suricata_rm_blocked_wday, "root");
+ }
}
function sync_suricata_package_config() {