Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/examples/udhcp/simple.script

    r821 r2725  
    11#!/bin/sh
    2 
    32# udhcpc script edited by Tim Riker <Tim@Rikers.org>
    43
    5 [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
     4RESOLV_CONF="/etc/resolv.conf"
    65
    7 RESOLV_CONF="/etc/resolv.conf"
     6[ -n "$1" ] || { echo "Error: should be called from udhcpc"; exit 1; }
     7
     8NETMASK=""
     9[ -n "$subnet" ] && NETMASK="netmask $subnet"
     10BROADCAST="broadcast +"
    811[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
    9 [ -n "$subnet" ] && NETMASK="netmask $subnet"
    1012
    1113case "$1" in
    1214    deconfig)
    13         /sbin/ifconfig $interface 0.0.0.0
     15        echo "Setting IP address 0.0.0.0 on $interface"
     16        ifconfig $interface 0.0.0.0
    1417        ;;
    1518
    1619    renew|bound)
    17         /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
     20        echo "Setting IP address $ip on $interface"
     21        ifconfig $interface $ip $NETMASK $BROADCAST
    1822
    1923        if [ -n "$router" ] ; then
    20             echo "deleting routers"
     24            echo "Deleting routers"
    2125            while route del default gw 0.0.0.0 dev $interface ; do
    2226                :
     
    2529            metric=0
    2630            for i in $router ; do
     31                echo "Adding router $i"
    2732                route add default gw $i dev $interface metric $((metric++))
    2833            done
    2934        fi
    3035
    31         echo -n > $RESOLV_CONF
    32         [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
     36        echo "Recreating $RESOLV_CONF"
     37        echo -n > $RESOLV_CONF-$$
     38        [ -n "$domain" ] && echo "search $domain" >> $RESOLV_CONF-$$
    3339        for i in $dns ; do
    34             echo adding dns $i
    35             echo nameserver $i >> $RESOLV_CONF
     40            echo " Adding DNS server $i"
     41            echo "nameserver $i" >> $RESOLV_CONF-$$
    3642        done
     43        mv $RESOLV_CONF-$$ $RESOLV_CONF
    3744        ;;
    3845esac
Note: See TracChangeset for help on using the changeset viewer.