summaryrefslogtreecommitdiff
path: root/release/src/router/busybox/examples/udhcp/sample.bound
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 12:04:58 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 12:04:58 +0100
commit008d0be72b2f160382c6e880765e96b64a050c65 (patch)
tree36f48a98a3815a408e2ce1693dd182af90f80305 /release/src/router/busybox/examples/udhcp/sample.bound
parent611becfb8726c60cb060368541ad98191d4532f5 (diff)
downloadtomato-008d0be72b2f160382c6e880765e96b64a050c65.tar.gz
tomato-008d0be72b2f160382c6e880765e96b64a050c65.tar.bz2
imported original firmware WRT54GL_v4.30.11_11_US
Diffstat (limited to 'release/src/router/busybox/examples/udhcp/sample.bound')
-rwxr-xr-xrelease/src/router/busybox/examples/udhcp/sample.bound30
1 files changed, 30 insertions, 0 deletions
diff --git a/release/src/router/busybox/examples/udhcp/sample.bound b/release/src/router/busybox/examples/udhcp/sample.bound
new file mode 100755
index 00000000..20035267
--- /dev/null
+++ b/release/src/router/busybox/examples/udhcp/sample.bound
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Sample udhcpc renew script
+
+RESOLV_CONF="/etc/udhcpc/resolv.conf"
+
+[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+[ -n "$subnet" ] && NETMASK="netmask $subnet"
+
+/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
+
+if [ -n "$router" ]
+then
+ echo "deleting routers"
+ while /sbin/route del default gw 0.0.0.0 dev $interface
+ do :
+ done
+
+ for i in $router
+ do
+ /sbin/route add default gw $i dev $interface
+ done
+fi
+
+echo -n > $RESOLV_CONF
+[ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
+for i in $dns
+do
+ echo adding dns $i
+ echo nameserver $i >> $RESOLV_CONF
+done \ No newline at end of file