mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Ticket #1023. Correct the widget code bringing it full speed with latest carp code.
This commit is contained in:
parent
83ae810386
commit
108cfddf3e
@ -339,11 +339,8 @@ function convert_ip_to_network_format($ip, $subnet) {
|
||||
* get_carp_interface_status($carpinterface): returns the status of a carp ip
|
||||
*/
|
||||
function get_carp_interface_status($carpinterface) {
|
||||
/* basically cache the contents of ifconfig statement
|
||||
to speed up this routine */
|
||||
global $carp_query;
|
||||
if($carp_query == "")
|
||||
$carp_query = split("\n", `/sbin/ifconfig $carpinterface | grep carp`);
|
||||
$carp_query = "";
|
||||
exec("/sbin/ifconfig $carpinterface | /usr/bin/grep -v grep | /usr/bin/grep carp:", $carp_query);
|
||||
foreach($carp_query as $int) {
|
||||
if(stristr($int, "MASTER"))
|
||||
return "MASTER";
|
||||
|
||||
@ -4,4 +4,4 @@
|
||||
$carp_status_title = "Carp Status";
|
||||
$carp_status_title_link = "carp_status.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -37,13 +37,14 @@ require_once("/usr/local/www/widgets/include/carp_status.inc");
|
||||
if(is_array($config['virtualip']['vip'])) {
|
||||
$carpint=0;
|
||||
foreach($config['virtualip']['vip'] as $carp) {
|
||||
if ($carp['mode'] != "carp") continue;
|
||||
if ($carp['mode'] != "carp")
|
||||
continue;
|
||||
$ipaddress = $carp['subnet'];
|
||||
$password = $carp['password'];
|
||||
$netmask = $carp['subnet_bits'];
|
||||
$netmask = $carp['subnet_bits'];
|
||||
$vhid = $carp['vhid'];
|
||||
$advskew = $carp['advskew'];
|
||||
$carp_int = find_carp_interface($ipaddress);
|
||||
$carp_int = "vip{$vhid}";
|
||||
$status = get_carp_interface_status($carp_int);
|
||||
?>
|
||||
<tr>
|
||||
@ -54,7 +55,7 @@ require_once("/usr/local/www/widgets/include/carp_status.inc");
|
||||
</td>
|
||||
<td width="70%" class="listr">
|
||||
<?php
|
||||
if($status == "MASTER") {
|
||||
if($status == "MASTER") {
|
||||
echo "<img src='/themes/".$g['theme']."/images/icons/icon_pass.gif' title=\"$status\">";
|
||||
} else if($status == "BACKUP") {
|
||||
echo "<img src='/themes/".$g['theme']."/images/icons/icon_pass_d.gif' title=\"$status\">";
|
||||
@ -73,4 +74,4 @@ require_once("/usr/local/www/widgets/include/carp_status.inc");
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user