Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Display reason for network failure #738

Merged
merged 1 commit into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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