summaryrefslogtreecommitdiff
path: root/root/usr/share/udhcpc/default.renew
diff options
context:
space:
mode:
authorMike Baker <mbm@openwrt.org>2004-03-28 00:20:21 +0000
committerMike Baker <mbm@openwrt.org>2004-03-28 00:20:21 +0000
commitfee8556c06c10bfed0af070b604f47554a24306f (patch)
tree04569b929ee1a66b3a55263f075e6249870af6b6 /root/usr/share/udhcpc/default.renew
parent71112885432bfe29b67e802d8995566b652c2b20 (diff)
downloadmtk-20170518-fee8556c06c10bfed0af070b604f47554a24306f.zip
mtk-20170518-fee8556c06c10bfed0af070b604f47554a24306f.tar.gz
mtk-20170518-fee8556c06c10bfed0af070b604f47554a24306f.tar.bz2
inital commit of 20040316
SVN-Revision: 4
Diffstat (limited to 'root/usr/share/udhcpc/default.renew')
-rwxr-xr-xroot/usr/share/udhcpc/default.renew37
1 files changed, 37 insertions, 0 deletions
diff --git a/root/usr/share/udhcpc/default.renew b/root/usr/share/udhcpc/default.renew
new file mode 100755
index 0000000..f2b9b40
--- /dev/null
+++ b/root/usr/share/udhcpc/default.renew
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Sample udhcpc renew script
+
+RESOLV_CONF="/tmp/resolv.conf"
+
+if test -n "$broadcast"; then
+ BROADCAST="broadcast $broadcast"
+fi
+
+if test -n "$subnet"; then
+ NETMASK="netmask $subnet"
+fi
+
+/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
+
+if test -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
+
+if test -n "$domain"; then
+ echo domain $domain >> $RESOLV_CONF
+fi
+
+for i in $dns; do
+ echo adding dns $i
+ echo nameserver $i >> $RESOLV_CONF
+done