Check that /etc/resolv.conf exists before trying to read it.

Fix whitespace nit introduced in previous commit.

MFC after:	1 week
This commit is contained in:
des 2018-11-27 09:46:01 +00:00
parent ace2d9b55f
commit 338d419cbd

View File

@ -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
;;
*)