inital commit of 20040316
[openwrt/svn-archive/archive.git] / root / usr / share / udhcpc / default.bound
1 #!/bin/sh
2 # Sample udhcpc renew script
3
4 RESOLV_CONF="/tmp/resolv.conf"
5
6 if test -n "$broadcast"; then
7 BROADCAST="broadcast $broadcast"
8 fi
9
10 if test -n "$subnet"; then
11 NETMASK="netmask $subnet"
12 fi
13
14 /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
15
16 if test -n "$router"; then
17 echo "deleting routers"
18 while /sbin/route del default gw 0.0.0.0 dev $interface
19 do :
20 done
21
22 for i in $router
23 do
24 /sbin/route add default gw $i dev $interface
25 done
26 fi
27
28 echo -n > $RESOLV_CONF
29
30 if test -n "$domain"; then
31 echo domain $domain >> $RESOLV_CONF
32 fi
33
34 for i in $dns; do
35 echo adding dns $i
36 echo nameserver $i >> $RESOLV_CONF
37 done