summaryrefslogtreecommitdiffstats
path: root/target/generic/target_skeleton/usr/share/udhcpc/default.script
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-02-17 17:17:48 +0000
committerEric Andersen <andersen@codepoet.org>2005-02-17 17:17:48 +0000
commit2b7460e3623308cb7d7b548b4d1340dcb024eabe (patch)
tree49ad0e316c518c705155f6af97cb92bbf9f377f7 /target/generic/target_skeleton/usr/share/udhcpc/default.script
parente58927e0e4423cef8bd0fef72a9fd4fb3d8c860b (diff)
downloadbuildroot-novena-2b7460e3623308cb7d7b548b4d1340dcb024eabe.tar.gz
buildroot-novena-2b7460e3623308cb7d7b548b4d1340dcb024eabe.zip
Move stuff around
Diffstat (limited to 'target/generic/target_skeleton/usr/share/udhcpc/default.script')
-rwxr-xr-xtarget/generic/target_skeleton/usr/share/udhcpc/default.script39
1 files changed, 39 insertions, 0 deletions
diff --git a/target/generic/target_skeleton/usr/share/udhcpc/default.script b/target/generic/target_skeleton/usr/share/udhcpc/default.script
new file mode 100755
index 000000000..a52a7f812
--- /dev/null
+++ b/target/generic/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