[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [RFC][UDHCPC][Suggestion] Is there possible to enable option 03
From:       馬克泡 <macpaul () gmail ! com>
Date:       2011-11-06 3:13:48
Message-ID: CACCg+XNqbh-ucQPjUk6aP-sXsjuStjD0oMydQ4+3aryWtqeWHA () mail ! gmail ! com
[Download RAW message or body]

Hi Denys,

2011/11/6 Denys Vlasenko <vda.linux@googlemail.com>:
> I don't have Ubuntu machine.
> This isn't the complete file.
>
> Can you send the complete file?
>

#!/bin/sh
# Busybox udhcpc dispatcher script. Copyright (C) 2009 by Axel Beckert.
#
# Based on the busybox example scripts and the old udhcp source
# package default.* scripts.

RESOLV_CONF="/etc/resolv.conf"

case $1 in
    bound|renew)
	[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
	[ -n "$subnet" ] && NETMASK="netmask $subnet"

	/sbin/ifconfig $interface $ip $BROADCAST $NETMASK

	if [ -n "$router" ]; then
	    echo "$0: Resetting default routes"
	    while /sbin/route del default gw 0.0.0.0 dev $interface; do :; done

	    metric=0
	    for i in $router; do
		/sbin/route add default gw $i dev $interface metric $metric
		metric=$(($metric + 1))
	    done
	fi

	# Update resolver configuration file
	R=""
	[ -n "$domain" ] && R="domain $domain
"
	for i in $dns; do
	    echo "$0: Adding DNS $i"
	    R="${R}nameserver $i
"
	done

	if [ -x /sbin/resolvconf ]; then
	    echo -n "$R" | resolvconf -a "${interface}.udhcpc"
	else
	    echo -n "$R" > "$RESOLV_CONF"
	fi
	;;

    deconfig)
	if [ -x /sbin/resolvconf ]; then
	    resolvconf -d "${interface}.udhcpc"
	fi
	/sbin/ifconfig $interface 0.0.0.0
	;;

    leasefail)
	echo "$0: Lease failed: $message"
	;;

    nak)
	echo "$0: Received a NAK: $message"
	;;

    *)
	echo "$0: Unknown udhcpc command: $1";
	exit 1;
	;;
esac


-- 
Best regards,
Macpaul Lin
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic