aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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