]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/dns.cgi
dns.cgi: Show recursor mode message even when we have some servers to show
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / dns.cgi
index d4278d8b9a484825f76f162365b9c4a68902c569..aac7955ec19d717db2798368153f46298b32da3c 100755 (executable)
@@ -418,10 +418,18 @@ END
 sub show_nameservers () {
        &Header::openbox('100%', 'center', "$Lang::tr{'dns title'}");
 
 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;
 
        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
        # 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}";
        }
 
                $dns_status_col = "${Header::colourred}";
        }
 
+       if ($recursor) {
+               $dns_status_string .= " (" . $Lang::tr{'dns recursor mode'} . ")";
+       }
+
 print <<END;
                <table width='100%'>
                        <tr>
 print <<END;
                <table width='100%'>
                        <tr>
@@ -705,25 +717,16 @@ print <<END;
                </table>
 END
 ;
                </table>
 END
 ;
-
                } else {
                } else {
-print <<END;
+                       print <<END;
                <table width="100%">
                <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>
                        <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
 END
-;
                }
 
        &Header::closebox();
                }
 
        &Header::closebox();