wok-stable diff busybox/stuff/udhcp.script @ rev 3032
alsa-utils: fix compile_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue May 12 10:36:46 2009 +0200 (2009-05-12) |
parents | |
children | bc79e85a1561 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/udhcp.script Tue May 12 10:36:46 2009 +0200 1.3 @@ -0,0 +1,46 @@ 1.4 +#!/bin/sh 1.5 + 1.6 +# udhcpc script edited by Tim Riker <Tim@Rikers.org> 1.7 + 1.8 +[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 1.9 + 1.10 +RESOLV_CONF="/etc/resolv.conf" 1.11 +[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" 1.12 +[ -n "$subnet" ] && NETMASK="netmask $subnet" 1.13 + 1.14 +case "$1" in 1.15 + deconfig) 1.16 + /sbin/ifconfig $interface 0.0.0.0 1.17 + for i in /etc/ipdown.d/*; do 1.18 + [ -e $i ] && . $i $interface 1.19 + done 1.20 + ;; 1.21 + 1.22 + renew|bound) 1.23 + /sbin/ifconfig $interface $ip $BROADCAST $NETMASK 1.24 + 1.25 + if [ -n "$router" ] ; then 1.26 + echo "deleting routers" 1.27 + while route del default gw 0.0.0.0 dev $interface ; do 1.28 + : 1.29 + done 1.30 + 1.31 + metric=0 1.32 + for i in $router ; do 1.33 + route add default gw $i dev $interface metric $((metric++)) 1.34 + done 1.35 + fi 1.36 + 1.37 + echo -n > $RESOLV_CONF 1.38 + [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF 1.39 + for i in $dns ; do 1.40 + echo adding dns $i 1.41 + echo nameserver $i >> $RESOLV_CONF 1.42 + done 1.43 + for i in /etc/ipup.d/*; do 1.44 + [ -e $i ] && . $i $interface $ip $dns 1.45 + done 1.46 + ;; 1.47 +esac 1.48 + 1.49 +exit 0