summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--remote/rootfs/rootfs-stage31/data/inc/functions5
1 files changed, 3 insertions, 2 deletions
diff --git a/remote/rootfs/rootfs-stage31/data/inc/functions b/remote/rootfs/rootfs-stage31/data/inc/functions
index ee2f0c25..248d0149 100644
--- a/remote/rootfs/rootfs-stage31/data/inc/functions
+++ b/remote/rootfs/rootfs-stage31/data/inc/functions
@@ -47,9 +47,9 @@ download() {
# Shuffle server list
local SERVERS=$(for SERVER in $SLX_CONFIG_SERVERS $SLX_KCL_SERVERS; do echo "$RANDOM $SERVER"; done | sort -u | sed -r 's/^[0-9]+ //')
- for TIMEOUT in 1 1 2; do
+ for TIMEOUT in 1 1 2 END; do
for SERVER in $SERVERS; do
- rm -f "$TARGET_PATH"
+ rm -f -- "${TARGET_PATH}"
wget -T 5 -q -O "$TARGET_PATH" "http://${SERVER}/${FILE_URL}"
RET=$?
if [ "x$RET" != "x0" -o ! -e "$TARGET_PATH" ]; then
@@ -60,6 +60,7 @@ download() {
return 0
fi
done
+ [ "$TIMEOUT" = "END" ] && break
echo "Trying again in $(($TIMEOUT * 250)) ms..."
usleep $(($TIMEOUT * 250000))
done