mac-address-set: add timeout to wait_on function
if a device is never getting ready on startup sequence, the wait_on() function runs forever. with this patch it aborts after 10 seconds. BugzID: 77171 Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
This commit is contained in:
parent
197b4f6f07
commit
2173bda09c
|
|
@ -66,8 +66,15 @@ wait_on() {
|
||||||
fi
|
fi
|
||||||
log_info "$device not ready"
|
log_info "$device not ready"
|
||||||
log_info "Waiting...."
|
log_info "Waiting...."
|
||||||
|
wait_timeout=0
|
||||||
while ! $cmd "$device" > /dev/null 2>/dev/null; do
|
while ! $cmd "$device" > /dev/null 2>/dev/null; do
|
||||||
|
if [ $wait_timeout -gt 10 ]; then
|
||||||
|
log_warning "Timeout after 10 seconds, exiting now.."
|
||||||
|
break
|
||||||
|
else
|
||||||
sleep 1
|
sleep 1
|
||||||
|
fi
|
||||||
|
wait_timeout=$(($wait_timeout+1))
|
||||||
done
|
done
|
||||||
log_info "$device ready"
|
log_info "$device ready"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue