From: Nathan Rini Date: Thu, 4 Oct 2018 16:04:29 +0000 (-0600) Subject: bugfix for initialization X-Git-Tag: 050~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b38fa412cb8b7e2bca1de1fff286465ebce05d1;p=thirdparty%2Fdracut.git bugfix for initialization exit with error if all retries fail --- diff --git a/modules.d/90livenet/livenetroot.sh b/modules.d/90livenet/livenetroot.sh index 608480937..d9b475581 100755 --- a/modules.d/90livenet/livenetroot.sh +++ b/modules.d/90livenet/livenetroot.sh @@ -6,8 +6,8 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh . /lib/url-lib.sh PATH=/usr/sbin:/usr/bin:/sbin:/bin -RETRIES={RETRIES:-100} -SLEEP={SLEEP:-5} +RETRIES={$RETRIES:-100} +SLEEP={$SLEEP:-5} [ -e /tmp/livenet.downloaded ] && exit 0 @@ -30,6 +30,11 @@ do if [ ! -z "$imgfile" -a -s "$imgfile" ]; then break else + if [ $i -eq $RETRIES ]; then + warn "failed to download live image after $i attempts." + exit 1 + fi + sleep $SLEEP fi done > /tmp/livenet.downloaded