File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,13 @@ MAX_RETRIES=10 # 10 retries * 3 seconds = 30 seconds tot
4141
4242while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
4343 # Get current IP address for vtnet0
44- IP_ADDR=$( ifconfig vtnet0 | grep ' inet ' | awk ' {print $2}' )
44+
45+ # It can happen that dhcpcd at the beggining assigns an APIPA address (169.254.x.x)
46+ # Wait for the correct IP assignment
47+ IP_ADDR_TO_CHECK=$( ifconfig vtnet0 | grep ' inet ' | awk ' {print $2}' )
48+ if ! echo " $IP_ADDR_TO_CHECK " | grep -q " ^169\.254" ; then
49+ IP_ADDR=$IP_ADDR_TO_CHECK
50+ fi
4551
4652 if [ -n " $IP_ADDR " ] && [ " $IP_ADDR " != " 0.0.0.0" ]; then
4753 echo " ---> DHCP successful! Acquired IP"
Original file line number Diff line number Diff line change @@ -279,9 +279,9 @@ detect_qnx_ip() {
279279 done
280280
281281 # Try to extract IP from DHCP status in logs
282- local ip_pattern=" IP: [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+"
282+ local ip_pattern=" IP address set to : [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+"
283283 if grep -q " $ip_pattern " " $OUTPUT_LOG " 2> /dev/null; then
284- detected_ip=$( grep " $ip_pattern " " $OUTPUT_LOG " | tail -1 | sed ' s/.*IP: \([0-9.]*\).*/\1/' )
284+ detected_ip=$( grep " $ip_pattern " " $OUTPUT_LOG " | tail -1 | sed ' s/.*IP address set to : \([0-9.]*\).*/\1/' )
285285 if [ -n " $detected_ip " ] && [ " $detected_ip " != " 0.0.0.0" ]; then
286286 echo " ✓ Detected QNX IP address from logs: $detected_ip "
287287 QNX_IP=" $detected_ip "
You can’t perform that action at this time.
0 commit comments