# File which contains the ca-certificates.
my $ca_certs_file = "/etc/ssl/certs/ca-bundle.crt";
+my $check_servers;
+
my %color = ();
my %mainsettings = ();
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
# Write the changed hash to the config file.
&General::writehasharray($servers_file, \%dns_servers);
+
+## Handle request to check the servers.
+#
+} elsif ($cgiparams{'SERVERS'} eq $Lang::tr{'dns check servers'}) {
+ $check_servers = 1;
}
# Hash to store the generic DNS settings.
<td align="center">
<strong>$Lang::tr{'remark'}</strong>
</td>
-
+END
+ # Check if the status should be displayed.
+ if ($check_servers) {
+print <<END
<td align="center">
<strong>$Lang::tr{'status'}</strong>
</td>
+END
+;
+ }
+
+print <<END
<td align="center" colspan="3">
<strong>$Lang::tr{'action'}</strong>
</td>
</tr>
END
+;
# Check the usage of ISP assigned nameservers is enabled.
my $id = 1;
my $status_colour;
# Only grab the status if the nameserver is enabled.
- if ($enabled eq "enabled") {
+ if (($check_servers) && ($enabled eq "enabled")) {
$status = &check_nameserver("$nameserver", "ping.ipfire.org", "$settings{'PROTO'}", "$tls_hostname");
}
<td align="center" $col>
$remark
</td>
-
- <td align="center" $col>
- <strong><font color="$status_colour"><abbr title="$status_message">$status_short</abbr></font></strong>
- </td>
END
;
+ # Display server status if requested.
+ if ($check_servers) {
+print <<END
+ <td align="center" $col>
+ <strong><font color="$status_colour"><abbr title="$status_message">$status_short</abbr></font></strong>
+ </td>
+END
+;
+ }
+
# Check if the id is greater than "2".
#
# Nameservers with an ID's of one or two are ISP assigned,
print <<END;
<tr>
<form method="post" action="$ENV{'SCRIPT_NAME'}">
- <td colspan="9" align="right"><input type="submit" name="SERVERS" value="$Lang::tr{'add'}"></td>
+ <td colspan="9" align="right">
+ <input type="submit" name="SERVERS" value="$Lang::tr{'add'}">
+ <input type="submit" name="SERVERS" value="$Lang::tr{'dns check servers'}">
+ </td>
</form>
</tr>
</table>
'dns address done' => 'The DNS server address settings are going to be saved.',
'dns address recon' => 'Trying to reconnect!',
'dns check failed' => 'DNS check failed',
+'dns check servers' => 'Check DNS Servers',
'dns configuration' => 'DNS Configuration',
'dns could not add server' => 'Could not add server - Reason:',
'dns desc' => 'If the red0 interface gets the IP address information via DHCP from the provider, the DNS server addresses will be set automatically. Now here you are able to change these DNS server IP addresses with your own ones.',