Skip to content

Commit

Permalink
Merge pull request #28 from ashcrow/honor-redirects
Browse files Browse the repository at this point in the history
coreos-installer: Honor redirects via curl
  • Loading branch information
yuqi-zhang authored May 13, 2019
2 parents 583c837 + 2bf888c commit d3fc540
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions coreos-installer
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d3fc540

Please sign in to comment.