aboutsummaryrefslogtreecommitdiff
path: root/examples/udhcp/sample.renew
diff options
context:
space:
mode:
authorRuss Dill <Russ.Dill@asu.edu>2002-10-14 21:41:28 +0000
committerRuss Dill <Russ.Dill@asu.edu>2002-10-14 21:41:28 +0000
commit61fb48930f45aa536584b2047f9e703186e8f69f (patch)
treee3b93e0a694be81939f8c4762553c43ffdb9b10b /examples/udhcp/sample.renew
parent9060a7315980bb05f42eab76b88746d43e138188 (diff)
downloadbusybox-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-xexamples/udhcp/sample.renew30
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
4RESOLV_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
11if [ -n "$router" ]
12then
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
22fi
23
24echo -n > $RESOLV_CONF
25[ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
26for i in $dns
27do
28 echo adding dns $i
29 echo nameserver $i >> $RESOLV_CONF
30done \ No newline at end of file