From 3a35f55f3c429d9da0699f4f35fa83f2a0a2dc4d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 20 Jan 2010 17:57:14 -0500 Subject: Stop fighting php bugs where a variable is not defined on one system yet it is defined on another. --- etc/inc/system.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'etc/inc/system.inc') 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']); -- cgit v1.1