From e32fd4accf3776dfd7312cba2d56a7e0e4a064b8 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Thu, 7 Aug 2008 00:33:32 +0000 Subject: use config rather than /etc/resolv.conf to get system set nameservers --- scripts/dns-forwarding/vyatta-dns-forwarding.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts/dns-forwarding') 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 { -- cgit v1.2.3