diff options
author | Abdoulaye Walsimou Gaye <walsimou@walsimou.com> | 2009-05-12 02:46:17 +0200 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <walsimou@walsimou.com> | 2009-05-12 02:46:17 +0200 |
commit | 8c0ea1194bc0905926fb9e211c3356f2348c7ca7 (patch) | |
tree | ba98e07ed70e19ef2b60b5ae3206bcd2ad5f3b51 /src/target_skeleton/usr/share/udhcpc/default.script | |
download | embtoolkit-8c0ea1194bc0905926fb9e211c3356f2348c7ca7.tar.gz embtoolkit-8c0ea1194bc0905926fb9e211c3356f2348c7ca7.tar.bz2 embtoolkit-8c0ea1194bc0905926fb9e211c3356f2348c7ca7.tar.xz |
Embtoolkit: Fisrt commit
This is the first commit in the embedded system toolkit git repository, formaly
embtoolkit. This porject aims to design a tool which helps on building an
embedded linux system. The goal of this porject is to use EGLIBC as C Library
for linux systems generated.
This initial commit is manely just a backup in order to save work done.
Signed-off-by: Abdoulaye Walsimou Gaye <walsimou@walsimou.com>
Diffstat (limited to 'src/target_skeleton/usr/share/udhcpc/default.script')
-rwxr-xr-x | src/target_skeleton/usr/share/udhcpc/default.script | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/target_skeleton/usr/share/udhcpc/default.script b/src/target_skeleton/usr/share/udhcpc/default.script new file mode 100755 index 0000000..a52a7f8 --- /dev/null +++ b/src/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 |