Subversion Repositories livecd

Rev

Rev 100 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 100 Rev 102
Line 527... Line 527...
527
#
527
#
528
get_dhcp_lease()
528
get_dhcp_lease()
529
{
529
{
530
    # create /dev/urandom (needed by udhcpc)
530
    # create /dev/urandom (needed by udhcpc)
531
    mknod /dev/urandom c 1 9
531
    mknod /dev/urandom c 1 9
-
 
532
    for iface in eth0 eth0 eth1 eth1; do
532
    echolog "Try to get DHCP lease on eth0"
533
	echolog "Try to get DHCP lease on $iface"
533
    udhcpc --now --quit --interface=eth0 --script=/bin/udhcpc.script
534
	udhcpc --now --quit --interface=$iface --script=/bin/udhcpc.script
534
    if [ $? -ne 0 ]; then
535
	[ $? -eq 0 ] && return
535
	echo "ERROR: couldn't get DHCP lease, trying again"
536
	echo "ERROR: couldn't get DHCP lease, trying again"
536
	udhcpc --now --quit --interface=eth0 --script=/bin/udhcpc.script
-
 
537
	if [ $? -ne 0 ]; then
537
    done
538
	    echo "ERROR: couldn't get DHCP lease, trying eth1"
-
 
539
	    udhcpc --now --quit --interface=eth1 --script=/bin/udhcpc.script
-
 
540
	    if [ $? -ne 0 ]; then
-
 
541
		echo "ERROR: couldn't get DHCP lease, trying again eth1"
-
 
542
		udhcpc --now --quit --interface=eth1 --script=/bin/udhcpc.script
-
 
543
		if [ $? -ne 0 ]; then
-
 
544
		    echo "ERROR: can't get DHCP lease on eth0 and eth1"
538
    echo "ERROR: can't get DHCP lease on eth0 and eth1"
545
		fi
-
 
546
	    fi
-
 
547
	fi
-
 
548
    fi
-
 
549
}
539
}
550
 
540