Skip to content

Commit

Permalink
WIP: Use awk to extract status_code
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanoogian committed Jun 13, 2024
1 parent bbbba91 commit c1fa280
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ curl_download() {

# allow curl to fail w/o exiting
set +e
headers=$(curl --tlsv1.2 --proto "=https" -w "%{http_code}" --silent --retry 5 -o "$output_file" -LN -D - "$url" 2>&1)
headers=$(curl --tlsv1.2 --proto "=https" --silent --retry 5 -o "$output_file" -LN -D - "$url" 2>&1)
exit_code=$?
set -e

status_code="$(echo "$headers" | tail -1)"
status_code="$(echo "$headers" | grep '^HTTP' | tail -1 | awk '{print $2}')"

if [ "$status_code" -ne 200 ]; then
log_debug "Request failed with http status $status_code"
Expand Down

0 comments on commit c1fa280

Please sign in to comment.