Commit 1140c4b1 authored by Adam Wujek's avatar Adam Wujek 💬

patches/barebox: fix tftp boot sequence

Second test of $? value was not always result of command
"tftp $eth0.ipaddr/wrboot wrboot", but sometimes result of first if statement
(in case first tftp was successful).

In other words, when there was file wrboot-$eth0.ethaddr on tftp server, script
was still fetching and executing wrboot.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 9aee73bf
......@@ -7,15 +7,18 @@ fi
# fetch wrboot-<MAC> script, or <IP>/wrboot or wrboot
tftp wrboot-$eth0.ethaddr wrboot
if [ "$?" -ne "0" ]; then
ret=$?
if [ "$ret" -ne "0" ]; then
sleep 1
tftp $eth0.ipaddr/wrboot wrboot
ret=$?
fi
if [ "$?" -ne "0" ]; then
if [ "$ret" -ne "0" ]; then
sleep 1
tftp wrboot wrboot
ret=$?
fi
if [ "$?" -eq "0" ]; then
if [ "$ret" -eq "0" ]; then
./wrboot
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment