From 9e911847c54d2b061899c602e3d6a43e958eca40 Mon Sep 17 00:00:00 2001 From: billz Date: Thu, 25 Sep 2025 01:54:56 -0700 Subject: [PATCH] Fix: correctly capture curl exit status after wait --- installers/raspbian.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/installers/raspbian.sh b/installers/raspbian.sh index 6f667147..c65a3568 100755 --- a/installers/raspbian.sh +++ b/installers/raspbian.sh @@ -308,7 +308,10 @@ function _check_internet() { tput civis # hide cursor # run check in background - ( curl -Is --connect-timeout 3 --max-time 15 https://github.com | head -n 1 | grep "HTTP/2 200" >/dev/null ) & + ( + curl -Is --connect-timeout 3 --max-time 15 https://github.com \ + | grep -q "^HTTP/2 200" + ) & local pid=$! # display spinner while curl runs @@ -318,8 +321,9 @@ function _check_internet() { done printf "\r" - # check exit status of curl - wait $pid || exit_code=$? + # capture exit status + wait "$pid" + exit_code=$? tput cnorm # restore cursor