Commit 0017f80d authored by Ad Schellevis's avatar Ad Schellevis

(legacy) cleanup more php errors

parent cc3dba63
...@@ -1987,10 +1987,16 @@ function interfaces_carp_setup() ...@@ -1987,10 +1987,16 @@ function interfaces_carp_setup()
} }
/* suck in configuration items */ /* suck in configuration items */
if ($config['hasync']) { if (isset($config['hasync'])) {
if (isset($config['hasync']['pfsyncenabled'])) {
$pfsyncenabled = $config['hasync']['pfsyncenabled']; $pfsyncenabled = $config['hasync']['pfsyncenabled'];
}
if (isset($config['hasync']['pfsyncinterface'])) {
$pfsyncinterface = $config['hasync']['pfsyncinterface']; $pfsyncinterface = $config['hasync']['pfsyncinterface'];
}
if (isset($config['hasync']['pfsyncpeerip'])) {
$pfsyncpeerip = $config['hasync']['pfsyncpeerip']; $pfsyncpeerip = $config['hasync']['pfsyncpeerip'];
}
} else { } else {
unset($pfsyncinterface); unset($pfsyncinterface);
unset($pfsyncenabled); unset($pfsyncenabled);
...@@ -2007,7 +2013,7 @@ function interfaces_carp_setup() ...@@ -2007,7 +2013,7 @@ function interfaces_carp_setup()
unset($carp_sync_int); unset($carp_sync_int);
/* setup pfsync interface */ /* setup pfsync interface */
if ($carp_sync_int and $pfsyncenabled) { if ($carp_sync_int && isset($pfsyncenabled)) {
if (is_ipaddr($pfsyncpeerip)) if (is_ipaddr($pfsyncpeerip))
$syncpeer = "syncpeer {$pfsyncpeerip}"; $syncpeer = "syncpeer {$pfsyncpeerip}";
else else
...@@ -2032,7 +2038,7 @@ function interfaces_carp_setup() ...@@ -2032,7 +2038,7 @@ function interfaces_carp_setup()
mwexec("/sbin/ifconfig pfsync0 -syncdev -syncpeer down", false); mwexec("/sbin/ifconfig pfsync0 -syncdev -syncpeer down", false);
} }
if($config['virtualip']['vip']) if(isset($config['virtualip']['vip']) && $config['virtualip']['vip'])
set_single_sysctl("net.inet.carp.allow", "1"); set_single_sysctl("net.inet.carp.allow", "1");
else else
set_single_sysctl("net.inet.carp.allow", "0"); set_single_sysctl("net.inet.carp.allow", "0");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment