File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -78,13 +78,17 @@ if [ $otaids == "null" ]; then
78
78
exit 0
79
79
fi
80
80
81
+ correctlyfinished=0
81
82
while [ $waittime -gt 0 ]; do
82
83
echo " Waiting for $waittime seconds for OTA process to complete..."
83
84
sleep 15
84
85
waittime=$(( waittime- 15 ))
85
86
# Check status of running processess...
86
- otastatusout=$( arduino-cloud-cli ota status --ota-ids $otaids --format json | grep in_progress | wc -l)
87
- if [ " $otastatusout " -eq 0 ]; then
87
+ otastatuslines=$( arduino-cloud-cli ota status --ota-ids $otaids --format json)
88
+ otastatusinpcnt=$( echo $otastatuslines | grep in_progress | wc -l)
89
+ otastatuspencnt=$( echo $otastatuslines | grep pending | wc -l)
90
+ if [[ $otastatusinpcnt -eq 0 && $otastatuspencnt -eq 0 ]]; then
91
+ correctlyfinished=1
88
92
break
89
93
fi
90
94
done
@@ -93,7 +97,7 @@ echo ""
93
97
echo " Status report:"
94
98
arduino-cloud-cli ota status --ota-ids $otaids
95
99
96
- if [ $waittime -le 0 ]; then
100
+ if [ $correctlyfinished -eq 1 ]; then
97
101
echo " OTA process did not complete within the specified time for some boards"
98
102
exit 1
99
103
else
You can’t perform that action at this time.
0 commit comments