aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-01-13 13:38:53 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2014-01-13 13:38:53 +0100
commit2e66daca654d130b820a4f0498de7f0ec355039a (patch)
treebbc54616cb4b0ed75205a1f812982cfe7f13cc30
parentd74f8435ea7479fe558efa63c2ecc9aed5662db2 (diff)
downloadbusybox-w32-2e66daca654d130b820a4f0498de7f0ec355039a.tar.gz
busybox-w32-2e66daca654d130b820a4f0498de7f0ec355039a.tar.bz2
busybox-w32-2e66daca654d130b820a4f0498de7f0ec355039a.zip
examples/udhcp: do not rewrite resolv.conf if no DNS servers. Closes 6788
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-xexamples/udhcp/sample.bound18
-rwxr-xr-xexamples/udhcp/sample.renew18
2 files changed, 22 insertions, 14 deletions
diff --git a/examples/udhcp/sample.bound b/examples/udhcp/sample.bound
index bd3569c77..7c9d857e0 100755
--- a/examples/udhcp/sample.bound
+++ b/examples/udhcp/sample.bound
@@ -22,10 +22,14 @@ then
22 done 22 done
23fi 23fi
24 24
25echo -n > $RESOLV_CONF 25# Only replace resolv.conf is we have at least one DNS server
26[ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF 26if [ -n "$dns" ]
27for i in $dns 27then
28do 28 echo -n > $RESOLV_CONF
29 echo adding dns $i 29 [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
30 echo nameserver $i >> $RESOLV_CONF 30 for i in $dns
31done 31 do
32 echo adding dns $i
33 echo nameserver $i >> $RESOLV_CONF
34 done
35fi
diff --git a/examples/udhcp/sample.renew b/examples/udhcp/sample.renew
index ea368fc9e..4dce8486a 100755
--- a/examples/udhcp/sample.renew
+++ b/examples/udhcp/sample.renew
@@ -22,10 +22,14 @@ then
22 done 22 done
23fi 23fi
24 24
25echo -n > $RESOLV_CONF 25# Only replace resolv.conf is we have at least one DNS server
26[ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF 26if [ -n "$dns" ]
27for i in $dns 27then
28do 28 echo -n > $RESOLV_CONF
29 echo adding dns $i 29 [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
30 echo nameserver $i >> $RESOLV_CONF 30 for i in $dns
31done 31 do
32 echo adding dns $i
33 echo nameserver $i >> $RESOLV_CONF
34 done
35fi