Lines 32-39
Link Here
|
32 |
dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${iface}\})" |
32 |
dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${iface}\})" |
33 |
inet6_IFACE="$(eval echo \$\{inet6_${iface}\})" |
33 |
inet6_IFACE="$(eval echo \$\{inet6_${iface}\})" |
34 |
alias_IFACE="$(eval echo \$\{alias_${iface}\})" |
34 |
alias_IFACE="$(eval echo \$\{alias_${iface}\})" |
35 |
status_IFACE="$(ifconfig | gawk -v IFACE="${iface}" '/Link/ { if ($1 == IFACE) print "up" }')" |
35 |
status_IFACE="$(ifconfig ${iface} | gawk '/UP/ { print "up" }')" |
36 |
carrier_IFACE="$(ifconfig | gawk -v IFACE="${iface}" '/RUNNING/ { if ($1 == IFACE) print "running" }')" |
|
|
37 |
vlans="$(eval echo \$\{iface_${IFACE}_vlans\})" |
36 |
vlans="$(eval echo \$\{iface_${IFACE}_vlans\})" |
38 |
} |
37 |
} |
39 |
|
38 |
|
Lines 62-69
Link Here
|
62 |
# Check that eth0 was not brough up by the kernel ... |
61 |
# Check that eth0 was not brough up by the kernel ... |
63 |
if [ "${status_IFACE}" != "up" ] |
62 |
if [ "${status_IFACE}" != "up" ] |
64 |
then |
63 |
then |
|
|
64 |
# Bring up the interface to enable check for carrier |
65 |
/sbin/ifconfig ${IFACE} up >/dev/null || { |
66 |
retval=$? |
67 |
eend ${retval} "Failed to bring ${IFACE} up" |
68 |
return ${retval} |
69 |
} |
65 |
# Check that the interface has a carrier |
70 |
# Check that the interface has a carrier |
66 |
if [ "${carrier_IFACE}" = "running" ] |
71 |
/sbin/ifconfig ${IFACE} |grep -q 'RUNNING' >/dev/null |
|
|
72 |
if [ $? -eq 0 ] |
67 |
then |
73 |
then |
68 |
/sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || { |
74 |
/sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || { |
69 |
retval=$? |
75 |
retval=$? |
Lines 71-76
Link Here
|
71 |
return ${retval} |
77 |
return ${retval} |
72 |
} |
78 |
} |
73 |
else |
79 |
else |
|
|
80 |
/sbin/ifconfig ${IFACE} down >/dev/null |
74 |
eend 1 "${IFACE} is not plugged in or has no carrier signal" |
81 |
eend 1 "${IFACE} is not plugged in or has no carrier signal" |
75 |
return 1 |
82 |
return 1 |
76 |
fi |
83 |
fi |