From 9df1e738221b44128cf833ce0e9fbf113e258587 Mon Sep 17 00:00:00 2001 From: Nic Manoogian Date: Thu, 13 Jun 2024 11:03:04 -0400 Subject: [PATCH] Revert "WIP: Use awk to extract status_code" This reverts commit f2cb99649e66c50989f0379ae8357178af395a5d. --- scripts/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 8cf32558..c35a2c85 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -146,11 +146,11 @@ curl_download() { # allow curl to fail w/o exiting set +e - headers=$(curl --tlsv1.2 --proto "=https" --silent --retry 5 -o "$output_file" -LN -D - "$url" 2>&1) + headers=$(curl --tlsv1.2 --proto "=https" -w "%{http_code}" --silent --retry 5 -o "$output_file" -LN -D - "$url" 2>&1) exit_code=$? set -e - status_code="$(echo "$headers" | grep '^HTTP' | tail -1 | awk '{print $2}')" + status_code="$(echo "$headers" | tail -1)" if [ "$status_code" -ne 200 ]; then log_debug "Request failed with http status $status_code"