summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-10-01 15:41:01 +0000
committerErmal Luçi <eri@pfsense.org>2009-10-01 15:41:01 +0000
commita6726cf24d445af12a7a483576e33afb2f8948c0 (patch)
tree7638690124920423cac67d097cc852c3a847f574
parent1fb2bf250fd90e3d8f4720dd486fa62922a9ee97 (diff)
downloadpfsense-a6726cf24d445af12a7a483576e33afb2f8948c0.zip
pfsense-a6726cf24d445af12a7a483576e33afb2f8948c0.tar.gz
Write the rules with php provided tools to avoid forking unecessary.
Suggested-by: billm@
-rw-r--r--etc/inc/interfaces.inc13
1 files changed, 9 insertions, 4 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 9dcf6e3..d291171 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1007,10 +1007,15 @@ function interfaces_carp_setup() {
/* install rules to alllow pfsync to sync up during boot
* carp interfaces will remain down until the bootup sequence finishes
*/
- exec("echo pass quick proto carp all keep state > {$g['tmp_path']}/rules.boot");
- exec("echo pass quick proto pfsync all >> {$g['tmp_path']}/rules.boot");
- exec("echo pass out quick from any to any keep state >> {$g['tmp_path']}/rules.boot");
- exec("/sbin/pfctl -f {$g['tmp_path']}/rules.boot");
+ $fd = fopen("{$g['tmp_path']}/rules.boot", "w");
+ if ($fd) {
+ fwrite($fd, "echo pass quick proto carp all keep state\n");
+ fwrite($fd, "echo pass quick proto pfsync all\n");
+ fwrite($fd, "echo pass out quick from any to any keep state\n");
+ fclose($fd);
+ mwexec("/sbin/pfctl -f {$g['tmp_path']}/rules.boot");
+ } else
+ log_error("Could not create rules.boot file!");
}
/* setup pfsync interface */
OpenPOWER on IntegriCloud