From 13470c0df31e74f3dff2efd881db7b5cb4d1b681 Mon Sep 17 00:00:00 2001 From: Bastian Hofmann Date: Thu, 26 Nov 2020 12:25:30 +0100 Subject: [PATCH] Fix install.sh script if curl is not present (#414) At least with bash 5.0.18, GNU Wget 1.20.3 and GNU Awk 5.1.0 the wget installation methods fails because the awk regex does not match the location header. In these versions, instead of `/^ Location:...` it must be `/^Location:...`. In order to retain compatibility with other versions having a different behavior, I changed it to `/^\s*Location:...`. Signed-off-by: Bastian Hofmann --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5bd699cc..e0e5a1e9 100755 --- a/install.sh +++ b/install.sh @@ -86,7 +86,7 @@ checkLatestVersion() { if type "curl" > /dev/null; then TAG=$(curl -Ls -o /dev/null -w %{url_effective} $latest_release_url | grep -oE "[^/]+$" ) elif type "wget" > /dev/null; then - TAG=$(wget $latest_release_url --server-response -O /dev/null 2>&1 | awk '/^ Location: /{DEST=$2} END{ print DEST}' | grep -oE "[^/]+$") + TAG=$(wget $latest_release_url --server-response -O /dev/null 2>&1 | awk '/^\s*Location: /{DEST=$2} END{ print DEST}' | grep -oE "[^/]+$") fi }