fix: Display reason for network failure (#738)

This commit is contained in:
Kroese 2024-05-17 16:09:47 +02:00 committed by GitHub
parent 2ec37e2802
commit 1f1007a0f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -149,6 +149,8 @@ if [ ! -s "$RDC" ]; then
fKill "progress.sh" fKill "progress.sh"
(( rc == 4 )) && error "Failed to download $LOC , network failure!" && exit 60
if (( rc != 0 )); then if (( rc != 0 )); then
if (( rc != 22 )) && (( rc != 56 )); then if (( rc != 22 )) && (( rc != 56 )); then
error "Failed to download $LOC, reason: $rc" && exit 60 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=$?; } || : { wget "$LOC" -O "$PAT" -q --no-check-certificate --timeout=10 --show-progress "$PROGRESS"; rc=$?; } || :
fKill "progress.sh" 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 (( rc != 0 )) && error "Failed to download $LOC , reason: $rc" && exit 60
tar --extract --file="$PAT" --directory="$(dirname "$RD")"/. "$(basename "$RD")" 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=$?; } || : { wget "$URL" -O "$PAT" -q --no-check-certificate --timeout=10 --show-progress "$PROGRESS"; rc=$?; } || :
fKill "progress.sh" 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 (( rc != 0 )) && error "Failed to download $URL , reason: $rc" && exit 69
fi fi