aboutsummaryrefslogtreecommitdiffstats
path: root/packages/snort/snort_check_for_rule_updates.php
diff options
context:
space:
mode:
Diffstat (limited to 'packages/snort/snort_check_for_rule_updates.php')
-rw-r--r--packages/snort/snort_check_for_rule_updates.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/snort/snort_check_for_rule_updates.php b/packages/snort/snort_check_for_rule_updates.php
index ca118f9b..fc27eb83 100644
--- a/packages/snort/snort_check_for_rule_updates.php
+++ b/packages/snort/snort_check_for_rule_updates.php
@@ -36,6 +36,20 @@ require_once("functions.inc");
require_once("/usr/local/pkg/snort.inc");
require_once("service-utils.inc");
+/* check to see if carp settings exist, and get a handle */
+if($config['installedpackages']['carpsettings']) {
+ $carp = &$config['installedpackages']['carpsettings']['config'][0];
+ $password = $carp['password'];
+}
+
+/* if we are not a CARP cluster master, sleep for a random
+ * amount of time allowing for other members to download the configuration
+ */
+if(!$password) {
+ $sleepietime = rand(5,700);
+ sleep($sleepietime);
+}
+
$last_ruleset_download = $config['installedpackages']['snort']['last_ruleset_download'];
$text = file_get_contents("http://www.snort.org/pub-bin/downloads.cgi");
if (preg_match_all("/.*RELEASED\: (.*)\</", $text, $matches))