network/ifup.sh: before doing dhcp, check, if the link has a carrier
parent
7c8da72c11
commit
271cd19dbe
|
@ -87,6 +87,10 @@ do_dhcp() {
|
||||||
# dhclient-script will mark the netif up and generate the online
|
# dhclient-script will mark the netif up and generate the online
|
||||||
# event for nfsroot
|
# event for nfsroot
|
||||||
# XXX add -V vendor class and option parsing per kernel
|
# XXX add -V vendor class and option parsing per kernel
|
||||||
|
if ! iface_has_link $netif; then
|
||||||
|
echo "No carrier detected"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
echo "Starting dhcp for interface $netif"
|
echo "Starting dhcp for interface $netif"
|
||||||
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif \
|
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif \
|
||||||
|| echo "dhcp failed"
|
|| echo "dhcp failed"
|
||||||
|
|
Loading…
Reference in New Issue