From 678627f3499eb0b7e08adabbfee77be801065689 Mon Sep 17 00:00:00 2001 From: Nathan Rini Date: Wed, 19 Sep 2018 12:05:05 -0600 Subject: [PATCH] retry image download forever --- modules.d/90livenet/livenetroot.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules.d/90livenet/livenetroot.sh b/modules.d/90livenet/livenetroot.sh index b7592bc0a..b9cbd4449 100755 --- a/modules.d/90livenet/livenetroot.sh +++ b/modules.d/90livenet/livenetroot.sh @@ -13,14 +13,17 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin netroot="$2" liveurl="${netroot#livenet:}" info "fetching $liveurl" -imgfile=$(fetch_url "$liveurl") -if [ $? != 0 ]; then - warn "failed to download live image: error $?" - exit 1 -fi +imgfile= +until [ ! -z "$imgfile" -a -s "$imgfile" ] +do + imgfile=$(fetch_url "$liveurl") -> /tmp/livenet.downloaded + if [ $? != 0 ]; then + warn "failed to download live image: error $?" + imgfile= + fi +done > /tmp/livenet.downloaded # TODO: couldn't dmsquash-live-root handle this? if [ ${imgfile##*.} = "iso" ]; then -- 2.47.3