From: agaffney Date: Tue, 29 Jul 2008 12:31:43 +0000 (-0500) Subject: Add support to udhcpc.scripts for default route and DNS servers/domain X-Git-Tag: v3.4.10.902~57 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2f1aaf499595a99dc3e88e5ac5eca7ce69bdc418;p=genkernel.git Add support to udhcpc.scripts for default route and DNS servers/domain --- diff --git a/ChangeLog b/ChangeLog index a580dff..c2c58b1 100644 --- 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 defaults/udhcpc.scripts: + Add support to udhcpc.scripts for default route and DNS servers/domain + 29 Jul 2008; Andrew Gaffney defaults/initrd.scripts: Remove check for >=2.6 for mounting sysfs diff --git a/defaults/udhcpc.scripts b/defaults/udhcpc.scripts index a108a8b..1890f8a 100644 --- a/defaults/udhcpc.scripts +++ b/defaults/udhcpc.scripts @@ -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