Bump version to 3.4.41
[genkernel.git] / defaults / udhcpc.scripts
1 #!/bin/sh
2
3 [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
4
5 case ${1} in
6         renew|bound)
7                 [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
8                 [ -n "$subnet" ] && NETMASK="netmask $subnet"
9                 [ -n "$rootpath" ] && echo "$rootpath" > /rootpath
10                 [ -n "$hostname" ] && hostname ${hostname}
11
12                 busybox ifconfig $interface $ip $BROADCAST $NETMASK
13                 if [ -n "${router}" ]
14                 then
15                         while route del default gw 0.0.0.0 dev $interface; do
16                                 :
17                         done
18
19                         for i in ${router}
20                         do
21                                 busybox route add default gw ${i}
22                         done
23                 fi
24                 [ -n "$domain" ] && echo "domain ${domain}" >> /etc/resolv.conf
25                 if [ -n "${dns}" ]
26                 then
27                         for i in ${dns}
28                         do
29                                 echo "nameserver ${i}" >> /etc/resolv.conf
30                         done
31                 fi
32         ;;
33         deconfig)
34                 busybox ifconfig $interface 0.0.0.0
35         ;;
36 esac
37