aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-02-20 20:46:06 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-02-20 20:46:06 +0000
commit12fd06a85e59f3883ff74d76b2e381b2fb488202 (patch)
tree4dc57ccafc698c5f79efa0c7a8995e35f60558b2
parent7c36c80d36731bba40b06db20453241b82f44c4d (diff)
downloadpfsense-packages-12fd06a85e59f3883ff74d76b2e381b2fb488202.tar.gz
pfsense-packages-12fd06a85e59f3883ff74d76b2e381b2fb488202.tar.bz2
pfsense-packages-12fd06a85e59f3883ff74d76b2e381b2fb488202.zip
Do not foreach through carp hosts if non are defined.
-rw-r--r--packages/carp_status.php41
1 files changed, 21 insertions, 20 deletions
diff --git a/packages/carp_status.php b/packages/carp_status.php
index fee7781c..874a4f7b 100644
--- a/packages/carp_status.php
+++ b/packages/carp_status.php
@@ -70,26 +70,27 @@ include("fbegin.inc");
</tr>
<?php
-foreach($config['installedpackages']['carp']['config'] as $carp) {
- $ipaddress = $carp['ipaddress'];
- $premption = $carp['premption'];
- $password = $carp['password'];
- $netmask = $carp['netmask'];
- $vhid = $carp['vhid'];
- $advskew = $carp['advskew'];
- $pfsync = $carp['pfsync'];
- $synciface = $carp['synciface'];
- $carp_int = find_carp_interface($ipaddress);
- $status = get_carp_interface_status($carp_int);
- if(isset($carp['balancing'])) $balancing = "true"; else $balancing = "false";
- if(isset($carp['premtpion'])) $premption = "true"; else $premption = "false";
- if($synciface <> "") $sync_status = get_pfsync_interface_status($synciface);
- echo "<tr>";
- echo "<td class=\"listlr\"><center>" . $ipaddress . "</td>";
- echo "<td class=\"listlr\"><center>" . $status . "<br>" . $sync_status . "</td>";
- echo "<td class=\"listlr\"><center>" . $synciface . "</td>";
- echo "</tr>";
-}
+if($config['installedpackages']['carp']['config'] <> "")
+ foreach($config['installedpackages']['carp']['config'] as $carp) {
+ $ipaddress = $carp['ipaddress'];
+ $premption = $carp['premption'];
+ $password = $carp['password'];
+ $netmask = $carp['netmask'];
+ $vhid = $carp['vhid'];
+ $advskew = $carp['advskew'];
+ $pfsync = $carp['pfsync'];
+ $synciface = $carp['synciface'];
+ $carp_int = find_carp_interface($ipaddress);
+ $status = get_carp_interface_status($carp_int);
+ if(isset($carp['balancing'])) $balancing = "true"; else $balancing = "false";
+ if(isset($carp['premtpion'])) $premption = "true"; else $premption = "false";
+ if($synciface <> "") $sync_status = get_pfsync_interface_status($synciface);
+ echo "<tr>";
+ echo "<td class=\"listlr\"><center>" . $ipaddress . "</td>";
+ echo "<td class=\"listlr\"><center>" . $status . "<br>" . $sync_status . "</td>";
+ echo "<td class=\"listlr\"><center>" . $synciface . "</td>";
+ echo "</tr>";
+ }
?>