From 1f1007a0f1685f81a873274ea2934dea77afd167 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 17 May 2024 16:09:47 +0200 Subject: [PATCH] fix: Display reason for network failure (#738) --- src/install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/install.sh b/src/install.sh index ccf7d4e7..e29a847c 100644 --- a/src/install.sh +++ b/src/install.sh @@ -149,6 +149,8 @@ if [ ! -s "$RDC" ]; then fKill "progress.sh" + (( rc == 4 )) && error "Failed to download $LOC , network failure!" && exit 60 + if (( rc != 0 )); then if (( rc != 22 )) && (( rc != 56 )); then error "Failed to download $LOC, reason: $rc" && exit 60 @@ -171,6 +173,7 @@ if [ ! -s "$RDC" ]; then { wget "$LOC" -O "$PAT" -q --no-check-certificate --timeout=10 --show-progress "$PROGRESS"; rc=$?; } || : fKill "progress.sh" + (( rc == 4 )) && error "Failed to download $LOC , network failure!" && exit 60 (( rc != 0 )) && error "Failed to download $LOC , reason: $rc" && exit 60 tar --extract --file="$PAT" --directory="$(dirname "$RD")"/. "$(basename "$RD")" @@ -245,6 +248,7 @@ else { wget "$URL" -O "$PAT" -q --no-check-certificate --timeout=10 --show-progress "$PROGRESS"; rc=$?; } || : fKill "progress.sh" + (( rc == 4 )) && error "Failed to download $URL , network failure!" && exit 69 (( rc != 0 )) && error "Failed to download $URL , reason: $rc" && exit 69 fi