From: Nathan Rini Date: Wed, 19 Sep 2018 18:05:05 +0000 (-0600) Subject: retry image download forever X-Git-Tag: 050~121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=678627f3499eb0b7e08adabbfee77be801065689;p=thirdparty%2Fdracut.git retry image download forever --- 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