diff options
author | Russ Dill <Russ.Dill@asu.edu> | 2002-10-14 21:41:28 +0000 |
---|---|---|
committer | Russ Dill <Russ.Dill@asu.edu> | 2002-10-14 21:41:28 +0000 |
commit | 61fb48930f45aa536584b2047f9e703186e8f69f (patch) | |
tree | e3b93e0a694be81939f8c4762553c43ffdb9b10b /examples/udhcp/sample.renew | |
parent | 9060a7315980bb05f42eab76b88746d43e138188 (diff) | |
download | busybox-w32-61fb48930f45aa536584b2047f9e703186e8f69f.tar.gz busybox-w32-61fb48930f45aa536584b2047f9e703186e8f69f.tar.bz2 busybox-w32-61fb48930f45aa536584b2047f9e703186e8f69f.zip |
added full udhcp integration
Diffstat (limited to 'examples/udhcp/sample.renew')
-rwxr-xr-x | examples/udhcp/sample.renew | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/udhcp/sample.renew b/examples/udhcp/sample.renew new file mode 100755 index 000000000..c953e9758 --- /dev/null +++ b/examples/udhcp/sample.renew | |||
@@ -0,0 +1,30 @@ | |||
1 | #!/bin/sh | ||
2 | # Sample udhcpc bound script | ||
3 | |||
4 | RESOLV_CONF="/etc/udhcpc/resolv.conf" | ||
5 | |||
6 | [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" | ||
7 | [ -n "$subnet" ] && NETMASK="netmask $subnet" | ||
8 | |||
9 | /sbin/ifconfig $interface $ip $BROADCAST $NETMASK | ||
10 | |||
11 | if [ -n "$router" ] | ||
12 | then | ||
13 | echo "deleting routers" | ||
14 | while /sbin/route del default gw 0.0.0.0 dev $interface | ||
15 | do : | ||
16 | done | ||
17 | |||
18 | for i in $router | ||
19 | do | ||
20 | /sbin/route add default gw $i dev $interface | ||
21 | done | ||
22 | fi | ||
23 | |||
24 | echo -n > $RESOLV_CONF | ||
25 | [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF | ||
26 | for i in $dns | ||
27 | do | ||
28 | echo adding dns $i | ||
29 | echo nameserver $i >> $RESOLV_CONF | ||
30 | done \ No newline at end of file | ||