diff options
Diffstat (limited to 'src/netboot-base')
-rw-r--r-- | src/netboot-base/lib/udhcpc.script | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/netboot-base/lib/udhcpc.script b/src/netboot-base/lib/udhcpc.script new file mode 100644 index 0000000000..2d77f81bf8 --- /dev/null +++ b/src/netboot-base/lib/udhcpc.script @@ -0,0 +1,32 @@ +#!/bin/sh +# $Header: /var/cvsroot/gentoo/src/netboot-base/lib/udhcpc.script,v 1.1 2004/10/07 05:44:54 vapier Exp $ +# Stripped down udhcpc script + +deconfig() { + ifconfig $interface 0.0.0.0 +} + +bound() { + ifconfig $interface $ip netmask $subnet + [ -n "$router" ] && route add default gw $router + rm /etc/resolv.conf >/dev/null 2>&1 + for ns in $dns; do echo "nameserver $ns" >> /etc/resolv.conf; done + [ -n "$domain" ] && echo "search $domain" >> /etc/resolv.conf +} + +renew() { + route del default > /dev/null 2>&1 + ifconfig $interface $ip netmask $subnet + [ -n "$router" ] && route add default gw $router +} + +leasefail() { + ifconfig $interface down +} + +case $1 in + deconfig) deconfig;; + bound) bound;; + renew) renew;; + leasefail) leasefail;; +esac |