Add support to udhcpc.scripts for default route and DNS servers/domain
authoragaffney <agaffney@kagome.(none)>
Tue, 29 Jul 2008 12:31:43 +0000 (07:31 -0500)
committeragaffney <agaffney@kagome.(none)>
Tue, 29 Jul 2008 12:31:43 +0000 (07:31 -0500)
ChangeLog
defaults/udhcpc.scripts

index a580dff0ab42cef80c695a194db7f0b05a128985..c2c58b1891f7de28ae9e5a92489fb2283fd8e519 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 # Copyright 1999-2008 Gentoo Foundation; 2008 Chris Gianelloni
 # Distributed under the GPL v2
 
+  29 Jul 2008; Andrew Gaffney <agaffney@gentoo.org> defaults/udhcpc.scripts:
+  Add support to udhcpc.scripts for default route and DNS servers/domain
+
   29 Jul 2008; Andrew Gaffney <agaffney@gentoo.org> defaults/initrd.scripts:
   Remove check for >=2.6 for mounting sysfs
 
index a108a8b77a29f0f029e84f6e019583331f94eaa0..1890f8a17b3f14fa7ba04b5844ffc60d50e8ca55 100644 (file)
@@ -9,6 +9,21 @@ case ${1} in
                #[ -n "$dns" ] && echo "$dns" > /dns
 
                busybox ifconfig $interface $ip $BROADCAST $NETMASK
+               if [ -n "${router}" ]
+               then
+                       for i in ${router}
+                       do
+                               busybox route add default gw ${i}
+                       done
+               fi
+               [ -n "$domain" ] && echo "domain ${domain}" >> /etc/resolv.conf
+               if [ -n "${dns}" ]
+               then
+                       for i in ${dns}
+                       do
+                               echo "nameserver ${i}" >> /etc/resolv.conf
+                       done
+               fi
        ;;
        deconfig)
                busybox ifconfig $interface 0.0.0.0