summaryrefslogtreecommitdiff
path: root/contrib/pull-resolv-conf/client.up
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2016-11-21 09:37:33 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2016-11-21 09:37:33 +0100
commit20c8675ba46bda97330a4117c459a59a9f1c465e (patch)
treed888c714fb61947dd79dc44b64a4aaae2f70bfb7 /contrib/pull-resolv-conf/client.up
parentffca24bed7a03d95585ad02278667abe75d8b272 (diff)
New upstream version 2.4~beta1upstream/2.4_beta1
Diffstat (limited to 'contrib/pull-resolv-conf/client.up')
-rw-r--r--contrib/pull-resolv-conf/client.up13
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/pull-resolv-conf/client.up b/contrib/pull-resolv-conf/client.up
index b28d4d1..8858b47 100644
--- a/contrib/pull-resolv-conf/client.up
+++ b/contrib/pull-resolv-conf/client.up
@@ -50,9 +50,10 @@ nl='
# or
# "dhcp-option DNS 10.10.10.10" (multiple allowed)
-# each DNS option becomes a "nameserver" option in resolv.con
+# each DNS option becomes a "nameserver" option in resolv.conf
# if we get one DOMAIN, that becomes "domain" in resolv.conf
# if we get multiple DOMAINS, those become "search" lines in resolv.conf
+# if we get no DOMAINS, then don't use either domain or search.
while true; do
eval fopt=\$foreign_option_${i}
@@ -78,13 +79,15 @@ while true; do
i=$((i + 1))
done
-ds=domain
-if [ $ndoms -gt 1 ]; then
- ds=search
+ds=""
+if [ $ndoms -eq 1 ]; then
+ ds="${nl}domain"
+elif [ $ndoms -gt 1 ]; then
+ ds="${nl}search"
fi
# This is the complete file - "$domains" has a leading space already
-out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${nl}${ds}${domains}"
+out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${ds}${domains}"
# use resolvconf if it's available
if type resolvconf >/dev/null 2>&1; then