summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGaurav <gaurav.sinha@vyatta.com>2012-02-21 16:29:40 -0800
committerGaurav <gaurav.sinha@vyatta.com>2012-02-21 16:29:40 -0800
commitbfbd8238b2d6dad88178d9684f3af568d5182bce (patch)
treed7e46846972974c7817f39e661bb3f16ea5970b2 /scripts
parent0714631e49c6cd616e8afa5fea21ccc0925a72ca (diff)
downloadvyatta-op-bfbd8238b2d6dad88178d9684f3af568d5182bce.tar.gz
vyatta-op-bfbd8238b2d6dad88178d9684f3af568d5182bce.zip
Bug 4086:fixed order of display in show dns forwarding nameservers, removed redundant information
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-op-dns-forwarding.pl24
1 files changed, 18 insertions, 6 deletions
diff --git a/scripts/vyatta-op-dns-forwarding.pl b/scripts/vyatta-op-dns-forwarding.pl
index dc5fbf1..5f94c15 100755
--- a/scripts/vyatta-op-dns-forwarding.pl
+++ b/scripts/vyatta-op-dns-forwarding.pl
@@ -188,6 +188,9 @@ sub get_dns_nameservers {
$show_nameservers_output .= "-----------------------------------------------\n";
$show_nameservers_output .= " Nameservers configured for DNS forwarding\n";
$show_nameservers_output .= "-----------------------------------------------\n";
+ my $show_nameservers_output_dhcp;
+ my $show_nameservers_output_domain;
+ my $show_nameservers_output_nameserver;
my $line_flag;
## server=/test.com/1.1.1.1
@@ -204,9 +207,9 @@ sub get_dns_nameservers {
@domain_tokens = split(/\//, $nameserver);
if (!defined($line_flag)) {
$line_flag = 1;
- $show_nameservers_output .= "\n";
- $show_nameservers_output .= "Domain Overrides\n";
- $show_nameservers_output .= "\n";
+ $show_nameservers_output_domain .= "\n";
+ $show_nameservers_output_domain .= "Domain Overrides:\n";
+ $show_nameservers_output_domain .= "\n";
}
}
$active_nameservers[$active_nameserver_count] = $nameserver;
@@ -214,13 +217,22 @@ sub get_dns_nameservers {
my $nameserver_via = $nameserver_array[2];
if (@nameserver_array > 3){
my $dhcp_interface = $nameserver_array[3];
- $show_nameservers_output .= "$nameserver available via '$nameserver_via $dhcp_interface'\n";
+ $show_nameservers_output_dhcp .= "$nameserver available via '$nameserver_via $dhcp_interface'\n";
} elsif (@domain_tokens) {
- $show_nameservers_output .= "$domain_tokens[1] uses $domain_tokens[2] via '$nameserver_via'\n";
+ $show_nameservers_output_domain .= "$domain_tokens[1] uses $domain_tokens[2]\n";
} else {
- $show_nameservers_output .= "$nameserver available via '$nameserver_via'\n";
+ $show_nameservers_output_nameserver .= "$nameserver available via '$nameserver_via'\n";
}
}
+ if (defined ($show_nameservers_output_nameserver)) {
+ $show_nameservers_output .= $show_nameservers_output_nameserver;
+ }
+ if (defined ($show_nameservers_output_dhcp)) {
+ $show_nameservers_output .= $show_nameservers_output_dhcp;
+ }
+ if (defined ($show_nameservers_output_domain)) {
+ $show_nameservers_output .= $show_nameservers_output_domain ;
+ }
# then you need to get nameservers from /etc/resolv.conf that are not in dnsmasq.conf to show them as inactive