From ff2d667f748414a55188bc8c9d9c1d645d395a0f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 27 Sep 2006 03:38:08 +0000 Subject: Install crontab entry and restart cron if needed --- packages/snort/snort.inc | 9 +++++++++ packages/snort/snort.xml | 5 +++++ 2 files changed, 14 insertions(+) (limited to 'packages') diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc index e86ac148..f96d6293 100644 --- a/packages/snort/snort.inc +++ b/packages/snort/snort.inc @@ -106,6 +106,15 @@ function generate_snort_conf() { /* XXX: make multi wan friendly */ $snort_ext_int = $config['installedpackages']['snort']['config'][0]['iface_array'][0]; + $text = "*/60\t* \t 1\t *\t *\t root\t /usr/bin/nice -n20 /usr/local/pkg/snort_check_for_rule_updates.php"; + $file = "/etc/crontab"; + add_text_to_file($file, $text); + remove_text_from_file($file, $text); + exec("killall -HUP cron"); + + /* should we install a automatic update crontab entry? */ + $automaticrulesupdate = $config['installedpackages']['snort']['config'][0]['automaticrulesupdate']; + if($config['interfaces'][$snort_ext_int]['ipaddr'] == "pppoe") $snort_ext_int = "ng0"; diff --git a/packages/snort/snort.xml b/packages/snort/snort.xml index f7108d15..dd6b5a2e 100644 --- a/packages/snort/snort.xml +++ b/packages/snort/snort.xml @@ -39,6 +39,11 @@ 077 http://www.pfsense.com/packages/config/snort/snort_blocked.php + + /usr/local/pkg/ + 077 + http://www.pfsense.com/packages/config/snort/snort_check_for_rule_updates.php + snort snort.sh -- cgit v1.2.3