wok-current view busybox/stuff/udhcp.script @ rev 3830

Fix: udev want pci.ids uncompressed to cook
author Christophe Lincoln <pankso@slitaz.org>
date Thu Aug 06 23:57:26 2009 +0200 (2009-08-06)
parents
children bc79e85a1561
line source
1 #!/bin/sh
3 # udhcpc script edited by Tim Riker <Tim@Rikers.org>
5 [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
7 RESOLV_CONF="/etc/resolv.conf"
8 [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
9 [ -n "$subnet" ] && NETMASK="netmask $subnet"
11 case "$1" in
12 deconfig)
13 /sbin/ifconfig $interface 0.0.0.0
14 for i in /etc/ipdown.d/*; do
15 [ -e $i ] && . $i $interface
16 done
17 ;;
19 renew|bound)
20 /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
22 if [ -n "$router" ] ; then
23 echo "deleting routers"
24 while route del default gw 0.0.0.0 dev $interface ; do
25 :
26 done
28 metric=0
29 for i in $router ; do
30 route add default gw $i dev $interface metric $((metric++))
31 done
32 fi
34 echo -n > $RESOLV_CONF
35 [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
36 for i in $dns ; do
37 echo adding dns $i
38 echo nameserver $i >> $RESOLV_CONF
39 done
40 for i in /etc/ipup.d/*; do
41 [ -e $i ] && . $i $interface $ip $dns
42 done
43 ;;
44 esac
46 exit 0