From: Sven Höxter Date: Mon, 2 Mar 2020 12:42:50 +0000 (+0100) Subject: fix terraform downloader script location header parsing X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Fscripts.git;a=commitdiff_plain;h=1bc4324034e197e9c2692356bcf0bb9fefd70a33 fix terraform downloader script location header parsing Seems github implemented http2 somewhere and now the location header is lower case. --- diff --git a/artifactory/terraform-dl.sh b/artifactory/terraform-dl.sh index 19e5e34..f62be23 100755 --- a/artifactory/terraform-dl.sh +++ b/artifactory/terraform-dl.sh @@ -1,7 +1,7 @@ #!/bin/sh LATEST_LINK="https://github.com/hashicorp/terraform/releases/latest" -VERSION="$(curl -si ${LATEST_LINK} | grep Location | grep -Po '[0-9]\.[0-9]{1,2}\.[0-9]+')" +VERSION="$(curl -sI ${LATEST_LINK} | grep -i '^Location' | grep -Po '[0-9]\.[0-9]{1,2}\.[0-9]+')" BASE_DOWNLOAD="https://releases.hashicorp.com/terraform/${VERSION}/" ARCH="amd64" OS="linux"