Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- html/cgi-bin/dns.cgi | 71 ++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 35 deletions(-)
diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi index 4f3418a70..09fd50206 100755 --- a/html/cgi-bin/dns.cgi +++ b/html/cgi-bin/dns.cgi @@ -449,7 +449,7 @@ sub show_nameservers () { $dns_status_string .= " (" . $Lang::tr{'dns recursor mode'} . ")"; }
-print <<END; + print <<END; <table width='100%'> <tr> <td> @@ -458,7 +458,36 @@ print <<END; </td> </tr> </table> +END + + # Check the usage of ISP assigned nameservers is enabled. + my $id = 1; + + # Loop through the array which stores the files. + foreach my $file (@ISP_nameserver_files) { + # Grab the address of the nameserver. + my $address = &General::grab_address_from_file($file); + + # Check if we got an address. + if ($address) { + # Add the address to the hash of nameservers. + $dns_servers{$id} = [ "$address", "none", + ($settings{'USE_ISP_NAMESERVERS'} eq "on") ? "enabled" : "disabled", + "$Lang::tr{'dns isp assigned nameserver'}" ]; + + # Increase id by one. + $id++; + } + }
+ # Check some DNS servers have been configured. In this case + # the hash contains at least one key. + my $server_amount; + if (keys %dns_servers) { + # Sort the keys by their ID and store them in an array. + my @keys = sort { $a <=> $b } keys %dns_servers; + + print <<END; <br>
<table class="tbl" width='100%'> @@ -479,51 +508,23 @@ print <<END; <strong>$Lang::tr{'remark'}</strong> </td> END - # Check if the status should be displayed. - if ($check_servers) { -print <<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 + 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; - - # Loop through the array which stores the files. - foreach my $file (@ISP_nameserver_files) { - # Grab the address of the nameserver. - my $address = &General::grab_address_from_file($file); - - # Check if we got an address. - if ($address) { - # Add the address to the hash of nameservers. - $dns_servers{$id} = [ "$address", "none", - ($settings{'USE_ISP_NAMESERVERS'} eq "on") ? "enabled" : "disabled", - "$Lang::tr{'dns isp assigned nameserver'}" ]; - - # Increase id by one. - $id++; - } - } - - # Check some DNS servers have been configured. In this case - # the hash contains at least one key. - my $server_amount; - if (keys %dns_servers) { - # Sort the keys by their ID and store them in an array. - my @keys = sort { $a <=> $b } keys %dns_servers;
# Loop through all entries of the array/hash. foreach my $id (@keys) {
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- src/initscripts/helper/aws-setup | 2 -- 1 file changed, 2 deletions(-)
diff --git a/src/initscripts/helper/aws-setup b/src/initscripts/helper/aws-setup index cee78a283..2c3311fc2 100644 --- a/src/initscripts/helper/aws-setup +++ b/src/initscripts/helper/aws-setup @@ -212,8 +212,6 @@ import_aws_configuration() { # Save CONFIG_TYPE echo "CONFIG_TYPE=${config_type}" >> /var/ipfire/ethernet/settings
- - # Actions performed only on the very first start if [ ! -e "/var/ipfire/main/firstsetup_ok" ]; then # Enable SSH
This is mostly aesthetic because there are no ISP nameservers anyways that we could use here.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- src/initscripts/helper/aws-setup | 3 +++ src/initscripts/helper/azure-setup | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/src/initscripts/helper/aws-setup b/src/initscripts/helper/aws-setup index 2c3311fc2..884319822 100644 --- a/src/initscripts/helper/aws-setup +++ b/src/initscripts/helper/aws-setup @@ -214,6 +214,9 @@ import_aws_configuration() {
# Actions performed only on the very first start if [ ! -e "/var/ipfire/main/firstsetup_ok" ]; then + # Disable using ISP nameservers + sed -e "s/^USE_ISP_NAMESERVERS=.*/USE_ISP_NAMESERVERS=off/" -i /var/ipfire/dns/settings + # Enable SSH sed -e "s/ENABLE_SSH=.*/ENABLE_SSH=on/g" -i /var/ipfire/remote/settings
diff --git a/src/initscripts/helper/azure-setup b/src/initscripts/helper/azure-setup index d84ec3aca..291b8e0a4 100644 --- a/src/initscripts/helper/azure-setup +++ b/src/initscripts/helper/azure-setup @@ -240,6 +240,9 @@ import_azure_configuration() {
# Actions performed only on the very first start if [ ! -e "/var/ipfire/main/firstsetup_ok" ]; then + # Disable using ISP nameservers + sed -e "s/^USE_ISP_NAMESERVERS=.*/USE_ISP_NAMESERVERS=off/" -i /var/ipfire/dns/settings + # Enable SSH sed -e "s/ENABLE_SSH=.*/ENABLE_SSH=on/g" -i /var/ipfire/remote/settings