From bab23d7cb8291192c74519f7cca2ee0044992723 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Wed, 17 Sep 2008 19:27:17 -0700 Subject: Fix Bug 3607 Error setting DNS forwarding to use DHCP --- scripts/dns-forwarding/vyatta-dns-forwarding.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/dns-forwarding/vyatta-dns-forwarding.pl') diff --git a/scripts/dns-forwarding/vyatta-dns-forwarding.pl b/scripts/dns-forwarding/vyatta-dns-forwarding.pl index 4a011b6a..38f5ee67 100644 --- a/scripts/dns-forwarding/vyatta-dns-forwarding.pl +++ b/scripts/dns-forwarding/vyatta-dns-forwarding.pl @@ -119,7 +119,7 @@ sub dnsforwarding_get_values { if (@use_dhcp_nameservers != 0) { $use_dnsmasq_conf = 1; foreach my $interface (@use_dhcp_nameservers) { - my $dhcp_nameserver_count=`grep nameserver /etc/resolv.conf.dhclient-new-$interface | wc -l`; + my $dhcp_nameserver_count=`grep nameserver /etc/resolv.conf.dhclient-new-$interface 2>/dev/null | wc -l`; if ($dhcp_nameserver_count > 0) { my @dhcp_nameservers = `grep nameserver /etc/resolv.conf.dhclient-new-$interface`; for my $each_nameserver (@dhcp_nameservers) { @@ -149,7 +149,7 @@ sub dnsforwarding_write_file { sub check_nameserver { - my $cmd = `grep nameserver /etc/resolv.conf|wc -l`; + my $cmd = `grep nameserver /etc/resolv.conf 2>/dev/null | wc -l`; return $cmd; } -- cgit v1.2.3