diff --git a/html/cgi-bin/keepalived.cgi b/html/cgi-bin/keepalived.cgi index ea69e5e3a..9afb02807 100644 --- a/html/cgi-bin/keepalived.cgi +++ b/html/cgi-bin/keepalived.cgi @@ -59,6 +59,7 @@ if (open(FILE, "$loxilbipfile")) { &Header::showhttpheaders(); our @ITFs=('RED', 'GREEN'); my @STATE= ('MASTER', 'BACKUP'); +my $DUMMY_IP = '192.0.2.1'; #for HA master/backup state tracking #Settings1 for the first screen box foreach my $itf (@ITFs) { @@ -165,6 +166,14 @@ if ($hasettings{'ENABLE_HA'} eq "on") { $checked = "checked='checked'"; } +my $hastate = "
$Lang::tr{'standby'}
"; + +my @ips = &General::get_ipaddresses_from_interface("green0"); + +if (grep { $_ eq $DUMMY_IP } @ips) { + $hastate = "
$Lang::tr{'active'}
"; +} + my $sactive = "
$Lang::tr{'stopped'}
"; my @status = &General::system_output('/usr/local/bin/keepalivedctrl', 'status'); @@ -183,10 +192,17 @@ print <  $Lang::tr{'keepalived status'} $sactive + $hastate + + + + +   + - $Lang::tr{'enable'} - + $Lang::tr{'enable'} + END @@ -337,6 +353,7 @@ sub buildconf { print FILE "\t}" . "\n"; # virtual ipaddress print FILE "\tvirtual_ipaddress {" . "\n"; + print FILE "\t\t$DUMMY_IP" . "\n"; my @vips = split(/\|/, $hasettings{"virtual_ipaddress_${itf}"}); foreach my $ip (@vips) { print FILE "\t\t$ip" . "\n"; diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 7a249f7dd..63d52816d 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -141,6 +141,7 @@ 'activate' => 'Activate', 'activate user' => 'Activate user', 'active' => 'Active', +'standby' => 'Standby', 'add' => 'Add', 'add a host' => 'Add a host', 'add a new rule' => 'Add a new rule:', diff --git a/langs/zh/cgi-bin/zh.pl b/langs/zh/cgi-bin/zh.pl index 6b81cf5f3..743fc9d8b 100644 --- a/langs/zh/cgi-bin/zh.pl +++ b/langs/zh/cgi-bin/zh.pl @@ -138,6 +138,7 @@ 'activate' => '激活', 'activate user' => '激活用户', 'active' => 'Active', +'standby' => 'Standby', 'add' => '添加', 'add a host' => '添加主机', 'add a new rule' => '添加规则:',