mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 19:00:34 +02:00
dns.cgi: Show recursor mode message even when we have some servers to show
The message was not shown when we have received DNS servers from the provider. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -418,10 +418,18 @@ END
|
||||
sub show_nameservers () {
|
||||
&Header::openbox('100%', 'center', "$Lang::tr{'dns title'}");
|
||||
|
||||
# Determine if we are running in recursor mode
|
||||
my $recursor = 0;
|
||||
my $unbound_forward = qx(unbound-control forward);
|
||||
if ($unbound_forward =~ m/^off/) {
|
||||
$recursor = 1;
|
||||
}
|
||||
|
||||
my $dns_status_string;
|
||||
my $dns_status_col;
|
||||
my $dns_working;
|
||||
|
||||
|
||||
# Test if the DNS system is working.
|
||||
#
|
||||
# Simple send a request to unbound and check if it can resolve the
|
||||
@@ -437,6 +445,10 @@ sub show_nameservers () {
|
||||
$dns_status_col = "${Header::colourred}";
|
||||
}
|
||||
|
||||
if ($recursor) {
|
||||
$dns_status_string .= " (" . $Lang::tr{'dns recursor mode'} . ")";
|
||||
}
|
||||
|
||||
print <<END;
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
@@ -705,25 +717,16 @@ print <<END;
|
||||
</table>
|
||||
END
|
||||
;
|
||||
|
||||
} else {
|
||||
print <<END;
|
||||
print <<END;
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td colspan="6" align="center">
|
||||
<br>$Lang::tr{'dns recursor mode'}<br>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<form method="post" action="$ENV{'SCRIPT_NAME'}">
|
||||
<td colspan="6" align="right"><input type="submit" name="SERVERS" value="$Lang::tr{'add'}"></td>
|
||||
</form>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
END
|
||||
;
|
||||
}
|
||||
|
||||
&Header::closebox();
|
||||
|
||||
Reference in New Issue
Block a user