From 3ac1acb9ea70080aaaf49ae211835f057e60eefa Mon Sep 17 00:00:00 2001 From: mbm Date: Tue, 25 May 2004 04:32:27 +0000 Subject: Initial revision git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../usr/share/udhcpc/default.script | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 obsolete-buildroot/sources/target_skeleton/usr/share/udhcpc/default.script (limited to 'obsolete-buildroot/sources/target_skeleton/usr/share/udhcpc') diff --git a/obsolete-buildroot/sources/target_skeleton/usr/share/udhcpc/default.script b/obsolete-buildroot/sources/target_skeleton/usr/share/udhcpc/default.script new file mode 100755 index 000000000..a52a7f812 --- /dev/null +++ b/obsolete-buildroot/sources/target_skeleton/usr/share/udhcpc/default.script @@ -0,0 +1,39 @@ +#!/bin/sh + +# udhcpc script edited by Tim Riker + +[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 + +RESOLV_CONF="/etc/resolv.conf" +[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" +[ -n "$subnet" ] && NETMASK="netmask $subnet" + +case "$1" in + deconfig) + /sbin/ifconfig $interface 0.0.0.0 + ;; + + renew|bound) + /sbin/ifconfig $interface $ip $BROADCAST $NETMASK + + if [ -n "$router" ] ; then + echo "deleting routers" + while route del default gw 0.0.0.0 dev $interface ; do + : + done + + for i in $router ; do + route add default gw $i dev $interface + done + fi + + echo -n > $RESOLV_CONF + [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF + for i in $dns ; do + echo adding dns $i + echo nameserver $i >> $RESOLV_CONF + done + ;; +esac + +exit 0 -- cgit v1.2.3