From: Harald Hoyer Date: Tue, 18 Sep 2012 14:29:42 +0000 (+0200) Subject: 45url-lib/url-lib.sh: give info what URL curl failed to download X-Git-Tag: 024~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=914f531f3955e8416e6098c094a1356a0e7c9d81;p=thirdparty%2Fdracut.git 45url-lib/url-lib.sh: give info what URL curl failed to download 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 --- diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh index e9ece70a1..a8069efad 100755 --- a/modules.d/45url-lib/url-lib.sh +++ b/modules.d/45url-lib/url-lib.sh @@ -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