summaryrefslogtreecommitdiff
path: root/sources/target_skeleton/usr
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-11-15 02:55:17 +0000
committerEric Andersen <andersen@codepoet.org>2002-11-15 02:55:17 +0000
commit78431965205eb0f1fe8a0e240dcc2c20940fb1dd (patch)
treeea4f72e53a7f7ffc82e4a307de9cc80e939de3f7 /sources/target_skeleton/usr
parentcad581084a1d85f4fb88b466e6f36ad0128754f0 (diff)
Add udhcp, cleanup a few other loose ends.
-Erik
Diffstat (limited to 'sources/target_skeleton/usr')
-rwxr-xr-xsources/target_skeleton/usr/share/udhcpc/default.script39
1 files changed, 39 insertions, 0 deletions
diff --git a/sources/target_skeleton/usr/share/udhcpc/default.script b/sources/target_skeleton/usr/share/udhcpc/default.script
new file mode 100755
index 000000000..a52a7f812
--- /dev/null
+++ b/sources/target_skeleton/usr/share/udhcpc/default.script
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# udhcpc script edited by Tim Riker <Tim@Rikers.org>
+
+[ -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