From 1b38fa412cb8b7e2bca1de1fff286465ebce05d1 Mon Sep 17 00:00:00 2001 From: Nathan Rini Date: Thu, 4 Oct 2018 10:04:29 -0600 Subject: [PATCH] bugfix for initialization exit with error if all retries fail --- modules.d/90livenet/livenetroot.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 2.47.2