]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
bugfix for initialization
authorNathan Rini <nate@ucar.edu>
Thu, 4 Oct 2018 16:04:29 +0000 (10:04 -0600)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 25 Oct 2019 09:37:43 +0000 (11:37 +0200)
exit with error if all retries fail

modules.d/90livenet/livenetroot.sh

index 608480937a81d17b392373f9ed4ba03a2448f2a7..d9b475581260f6dc74c1ebf6d170cde38b1a1786 100755 (executable)
@@ -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