aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-03-06 18:44:05 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-03-06 18:44:05 -0500
commita299a9630a0da05293bad6f8a3687fa88430eda9 (patch)
tree121c390befeb2c486f5b655afff132fe2adeed06
parent4f2486c194e67475384419942c8d5b2c27fdb93e (diff)
downloadpfsense-packages-a299a9630a0da05293bad6f8a3687fa88430eda9.tar.gz
pfsense-packages-a299a9630a0da05293bad6f8a3687fa88430eda9.tar.bz2
pfsense-packages-a299a9630a0da05293bad6f8a3687fa88430eda9.zip
Ensure rules exists
-rw-r--r--config/apache_mod_security/apache_mod_security.inc22
1 files changed, 14 insertions, 8 deletions
diff --git a/config/apache_mod_security/apache_mod_security.inc b/config/apache_mod_security/apache_mod_security.inc
index 639b2d4f..46948c37 100644
--- a/config/apache_mod_security/apache_mod_security.inc
+++ b/config/apache_mod_security/apache_mod_security.inc
@@ -62,14 +62,6 @@ function apache_mod_security_restart() {
function apache_mod_security_install() {
global $config, $g;
- exec("/usr/bin/fetch -q -o " . rules_directory . "/10_asl_rules.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/10_asl_rules.conf");
- exec("/usr/bin/fetch -q -o " . rules_directory . "/a_exclude.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/a_exclude.conf");
- exec("/usr/bin/fetch -q -o " . rules_directory . "/blacklist.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/blacklist.conf");
- exec("/usr/bin/fetch -q -o " . rules_directory . "/rules/default.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/default.conf");
- exec("/usr/bin/fetch -q -o " . rules_directory . "/recons.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/recons.conf");
- exec("/usr/bin/fetch -q -o " . rules_directory . "/rootkits.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/rootkits.conf");
- exec("/usr/bin/fetch -q -o " . rules_directory . "/useragents.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/useragents.conf");
-
// We might be reinstalling and a configuration
// already exists.
generate_apache_configuration();
@@ -111,6 +103,20 @@ function apache_mod_security_deinstall() {
// Regenerate apache configuration and handle server restart
function apache_mod_security_resync() {
global $config, $g;
+ if(!file_exists(rules_directory . "/10_asl_rules.conf"))
+ exec("/usr/bin/fetch -q -o " . rules_directory . "/10_asl_rules.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/10_asl_rules.conf");
+ if(!file_exists(rules_directory . "/a_exclude.conf"))
+ exec("/usr/bin/fetch -q -o " . rules_directory . "/a_exclude.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/a_exclude.conf");
+ if(!file_exists(rules_directory . "/blacklist.conf"))
+ exec("/usr/bin/fetch -q -o " . rules_directory . "/blacklist.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/blacklist.conf");
+ if(!file_exists(rules_directory . "/default.conf"))
+ exec("/usr/bin/fetch -q -o " . rules_directory . "/rules/default.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/default.conf");
+ if(!file_exists(rules_directory . "/recons.conf"))
+ exec("/usr/bin/fetch -q -o " . rules_directory . "/recons.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/recons.conf");
+ if(!file_exists(rules_directory . "/rootkits.conf"))
+ exec("/usr/bin/fetch -q -o " . rules_directory . "/rootkits.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/rootkits.conf");
+ if(!file_exists(rules_directory . "/useragents.conf"))
+ exec("/usr/bin/fetch -q -o " . rules_directory . "/useragents.conf http://www.pfsense.com/packages/config/apache_mod_security/rules/useragents.conf");
generate_apache_configuration();
apache_mod_security_checkconfig();
apache_mod_security_restart();