Skip to content

Commit

Permalink
fix: Display reason for network failure (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese committed May 17, 2024
1 parent 2ec37e2 commit 1f1007a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1f1007a

Please sign in to comment.