Blame SOURCES/0270-livenet-don-t-attempt-to-download-the-image-for-ever.patch

712866
From e5f4bbd804e337a7efaf3a0cb4fc3a37b7e33b47 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Fri, 3 Jul 2015 14:00:33 +0200
712866
Subject: [PATCH] livenet: don't attempt to download the image for every
712866
 interface
712866
712866
https://bugzilla.redhat.com/show_bug.cgi?id=1152485
712866
---
712866
 modules.d/90livenet/livenetroot.sh | 10 +++++++++-
712866
 1 file changed, 9 insertions(+), 1 deletion(-)
712866
712866
diff --git a/modules.d/90livenet/livenetroot.sh b/modules.d/90livenet/livenetroot.sh
5c6c2a
index 1bbee55b..2e36ee98 100755
712866
--- a/modules.d/90livenet/livenetroot.sh
712866
+++ b/modules.d/90livenet/livenetroot.sh
712866
@@ -7,12 +7,20 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
712866
 
712866
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
712866
 
712866
+[ -e /tmp/livenet.downloaded ] && exit 0
712866
+
712866
 # args get passed from 40network/netroot
712866
 netroot="$2"
712866
 liveurl="${netroot#livenet:}"
712866
 info "fetching $liveurl"
712866
 imgfile=$(fetch_url "$liveurl")
712866
-[ $? = 0 ] || die "failed to download live image: error $?"
712866
+
712866
+if [ $? = 0 ]; then
712866
+	warn "failed to download live image: error $?"
712866
+	exit 1
712866
+fi
712866
+
712866
+> /tmp/livenet.downloaded
712866
 
712866
 # TODO: couldn't dmsquash-live-root handle this?
712866
 if [ ${imgfile##*.} = "iso" ]; then