]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
convert-snort: Try to download ruleset if none is present.
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 22 Feb 2019 09:04:27 +0000 (10:04 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Fri, 22 Feb 2019 09:04:27 +0000 (10:04 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/suricata/convert-snort

index 20ba353109e5f95f45a0943ac8acd304b6e8ce21..ca650b149a212d9f0074297d78626fec96d8fd11 100644 (file)
@@ -226,6 +226,14 @@ if (-f $snort_rules_tarball) {
 
        # Set correct ownership.
        &IDS::set_ownership("$IDS::rulestarball");
+
+# In case no tarball is present, try to download the ruleset.
+} else {
+       # Check if enought disk space is available.
+       if(&IDS::checkdiskspace()) {
+               # Call the download function and grab the new ruleset.
+               &IDS::downloadruleset();
+       }
 }
 
 #
@@ -236,6 +244,9 @@ if (-f $snort_rules_tarball) {
 if (-f $IDS::rulestarball) {
        # Launch oinkmaster by calling the subfunction.
        &IDS::oinkmaster();
+
+       # Set correct ownership for the rulesdir and files.
+       &IDS::set_ownership("$IDS::rulespath");
 }
 
 #