diff options
author | Mohit Mehta <mohit.mehta@vyatta.com> | 2008-08-07 00:33:32 +0000 |
---|---|---|
committer | Mohit Mehta <mohit.mehta@vyatta.com> | 2008-08-07 00:33:32 +0000 |
commit | e32fd4accf3776dfd7312cba2d56a7e0e4a064b8 (patch) | |
tree | fe1a6feb6dd63cb81ad2695bd2e45820f60da993 | |
parent | 6c6f88e7bca27a3695ae017236ec45290fcf5706 (diff) | |
download | vyatta-cfg-system-e32fd4accf3776dfd7312cba2d56a7e0e4a064b8.tar.gz vyatta-cfg-system-e32fd4accf3776dfd7312cba2d56a7e0e4a064b8.zip |
use config rather than /etc/resolv.conf to get system set nameservers
-rw-r--r-- | scripts/dns-forwarding/vyatta-dns-forwarding.pl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/dns-forwarding/vyatta-dns-forwarding.pl b/scripts/dns-forwarding/vyatta-dns-forwarding.pl index 60f61e16..cfa4ee9b 100644 --- a/scripts/dns-forwarding/vyatta-dns-forwarding.pl +++ b/scripts/dns-forwarding/vyatta-dns-forwarding.pl @@ -91,9 +91,11 @@ sub check_nameserver { sub check_system_nameserver { - my $num_all_nameservers = `grep nameserver /etc/resolv.conf|wc -l`; - my $num_dhcp_nameservers = `grep nameserver /etc/resolv.conf| grep vyatta_update_resolv|wc -l`; - return ($num_all_nameservers - $num_dhcp_nameservers); + my $config = new VyattaConfig; + $config->setLevel("system"); + my @system_nameservers = $config->returnValues("name-server"); + return(@system_nameservers); + } sub check_dhcp_nameserver { |