diff options
author | Scott Ullrich <sullrich@pfSense.org> | 2010-01-20 17:57:14 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfSense.org> | 2010-01-20 17:57:14 -0500 |
commit | 3a35f55f3c429d9da0699f4f35fa83f2a0a2dc4d (patch) | |
tree | eaa4288a83e5438432726740087d119faabbf4d2 /etc/inc/system.inc | |
parent | cac19f50aca6ae61766592c3198d2f8287a420ac (diff) | |
download | pfsense-3a35f55f3c429d9da0699f4f35fa83f2a0a2dc4d.zip pfsense-3a35f55f3c429d9da0699f4f35fa83f2a0a2dc4d.tar.gz |
Stop fighting php bugs where a variable is not defined on one system yet it is defined on another.
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 5891829..9d60d26 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -48,15 +48,22 @@ function activate_powerd() { } } +function get_default_sysctl_value($id) { + global $sysctls; + foreach($sysctls as $sysctl => $value) { + if($sysctl == $id) + return $value; + } +} + function activate_sysctls() { global $config, $g; - require("sysctl.inc"); exec("/sbin/sysctl net.enc.out.ipsec_bpf_mask=0x00000001"); exec("/sbin/sysctl net.enc.out.ipsec_filter_mask=0x00000001"); exec("/sbin/sysctl net.enc.in.ipsec_bpf_mask=0x00000002"); exec("/sbin/sysctl net.enc.in.ipsec_filter_mask=0x00000002"); - if (is_array($config['sysctl'])) { + if(is_array($config['sysctl'])) { foreach($config['sysctl']['item'] as $tunable) { if($tunable['value'] == "default") { $value = get_default_sysctl_value($tunable['tunable']); |