Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2018 09:46:01 +0000 (UTC)
From:      =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341010 - head/usr.sbin/unbound/setup
Message-ID:  <201811270946.wAR9k1hp020021@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Tue Nov 27 09:46:01 2018
New Revision: 341010
URL: https://svnweb.freebsd.org/changeset/base/341010

Log:
  Check that /etc/resolv.conf exists before trying to read it.
  Fix whitespace nit introduced in previous commit.
  
  MFC after:	1 week

Modified:
  head/usr.sbin/unbound/setup/local-unbound-setup.sh

Modified: head/usr.sbin/unbound/setup/local-unbound-setup.sh
==============================================================================
--- head/usr.sbin/unbound/setup/local-unbound-setup.sh	Tue Nov 27 09:41:47 2018	(r341009)
+++ head/usr.sbin/unbound/setup/local-unbound-setup.sh	Tue Nov 27 09:46:01 2018	(r341010)
@@ -218,7 +218,7 @@ gen_forward_conf() {
 	if [ "${use_tls}" = "yes" ] ; then
 		echo "        forward-tls-upstream: yes"
 		sed -nE \
-		    -e "s/^(${RE_forward_tls})$/        forward-addr: \\1/p"
+		    -e "s/^${RE_forward_tls}\$/        forward-addr: \\1/p"
 	else
 		sed -nE \
 		    -e "s/^${RE_forward_addr}\$/        forward-addr: \\1/p" \
@@ -411,8 +411,10 @@ main() {
 		style=recursing
 		;;
 	"")
-		echo "Extracting forwarders from ${resolv_conf}."
-		forwarders=$(get_nameservers <"${D}${resolv_conf}")
+		if [ -f "${D}${resolv_conf}" ] ; then
+			echo "Extracting forwarders from ${resolv_conf}."
+			forwarders=$(get_nameservers <"${D}${resolv_conf}")
+		fi
 		style=dynamic
 		;;
 	*)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811270946.wAR9k1hp020021>