From 2bf888c4d04b052603a9e084bcd27aea7de757a9 Mon Sep 17 00:00:00 2001 From: Steve Milner Date: Mon, 13 May 2019 09:15:29 -0400 Subject: [PATCH] coreos-installer: Honor redirects via curl Fixes RHBZ#1709247 See: https://bugzilla.redhat.com/show_bug.cgi?id=1709247 Signed-off-by: Steve Milner --- coreos-installer | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/coreos-installer b/coreos-installer index b396e9fae..292faf7c9 100755 --- a/coreos-installer +++ b/coreos-installer @@ -361,7 +361,7 @@ get_img_url() { fi IMAGE_URL=$(cat /tmp/image_url) - curl -sIf $IMAGE_URL >/tmp/image_info 2>&1 + curl -LsIf $IMAGE_URL >/tmp/image_info 2>&1 RETCODE=$? if [ $RETCODE -ne 0 ] then @@ -391,14 +391,14 @@ get_img_url() { get_sig_file_type() { SIG_URL=$IMAGE_URL.sig echo "Getting SIG_URL $SIG_URL" >> /tmp/debug - curl -sIf $SIG_URL > /dev/null 2>&1 + curl -LsIf $SIG_URL > /dev/null 2>&1 RETCODE=$? if [ $RETCODE -ne 0 ] then echo "$SIG_URL not found" >> /tmp/debug SIG_URL=$IMAGE_URL.sha256sum echo "Getting SIG_URL $SIG_URL" >> /tmp/debug - curl -sI $SIG_URL > /dev/null 2>&1 + curl -LsI $SIG_URL > /dev/null 2>&1 if [ $? -ne 0 ] then SIG_TYPE=none @@ -498,7 +498,7 @@ mount_tmpfs() { ######################################################### download_image() { echo "Downloading install image" >> /tmp/debug - curl -s -o /mnt/dl/imagefile.gz $IMAGE_URL & + curl -L -s -o /mnt/dl/imagefile.gz $IMAGE_URL & curlpid=$! while ps --pid $curlpid; do @@ -519,7 +519,7 @@ download_image() { ######################################################### download_sig() { echo "Getting signature" >> /tmp/debug - curl -s -o /mnt/dl/imagefile.gz.sig $SIG_URL + curl -L -s -o /mnt/dl/imagefile.gz.sig $SIG_URL if [ $? -ne 0 ] then dialog --title 'CoreOS Installer' --msgbox "Unable to download sig file. Dropping to shell" 10 70