Skip to content

Commit

Permalink
further fix to wait_iface script which first waits until the correspo…
Browse files Browse the repository at this point in the history
…nding interface sysfs directory exists before checking for the link/carrier.
  • Loading branch information
jens-maus committed Jul 15, 2018
1 parent 46d17df commit e185fb8
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
# long either. IF_WAIT_DELAY is in seconds.

if [[ -n "${IF_WAIT_DELAY}" ]]; then
/sbin/ip link set ${IFACE} up
printf "Waiting for interface %s to appear" "${IFACE}"
while [ ${IF_WAIT_DELAY} -gt 0 ]; do
CARRIER=$(cat /sys/class/net/${IFACE}/carrier)
if [[ -n "${CARRIER}" ]] && [[ ${CARRIER} -eq 1 ]]; then
printf "\n"
exit 0
if [[ -d "/sys/class/net/${IFACE}" ]]; then
/sbin/ip link set ${IFACE} up
CARRIER=$(cat /sys/class/net/${IFACE}/carrier)
if [[ -n "${CARRIER}" ]] && [[ ${CARRIER} -eq 1 ]]; then
printf "\n"
exit 0
fi
fi
sleep 1
printf "."
Expand Down

0 comments on commit e185fb8

Please sign in to comment.