]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
45url-lib/url-lib.sh: give info what URL curl failed to download
authorHarald Hoyer <harald@redhat.com>
Tue, 18 Sep 2012 14:29:42 +0000 (16:29 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 18 Sep 2012 14:31:24 +0000 (16:31 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=857836

Also allow self signed Certs and use "--insecure".

https://bugzilla.redhat.com/show_bug.cgi?id=852229

modules.d/45url-lib/url-lib.sh

index e9ece70a1a73a9f34c839b3ecf2f1205958dcbb6..a8069efad213b64d9feb1de64bb568a93821337d 100755 (executable)
@@ -54,7 +54,7 @@ add_url_handler() {
 
 export CURL_HOME="/run/initramfs/url-lib"
 mkdir -p $CURL_HOME
-curl_args="--location --retry 3 --fail --show-error"
+curl_args="--location --retry 3 --fail --show-error --insecure"
 
 curl_fetch_url() {
     local url="$1" outloc="$2"
@@ -66,7 +66,10 @@ curl_fetch_url() {
         ( cd "$outdir"; curl $curl_args --remote-name "$url" || return $? )
         outloc="$outdir/$(ls -A $outdir)"
     fi
-    [ -f "$outloc" ] || return 253
+    if ! [ -f "$outloc" ]; then
+           warn "Downloading '$url' failed!"
+           return 253
+    fi
     if [ -z "$2" ]; then echo "$outloc" ; fi
 }
 add_url_handler curl_fetch_url http https ftp