From 28d0ded576c2a7f9c54baeb819c3502ee038962e Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 5 Jun 2024 18:09:14 +0200 Subject: [PATCH] Update install.sh --- src/install.sh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/install.sh b/src/install.sh index be2180e..357c2ff 100644 --- a/src/install.sh +++ b/src/install.sh @@ -146,12 +146,13 @@ if [ ! -s "$RDC" ]; then fKill "progress.sh" - (( rc == 4 )) && error "Failed to download $LOC , network failure!" && exit 60 - (( rc == 8 )) && error "Failed to download $LOC , server issued an error response!" && exit 60 + ERR="Failed to download $LOC" + (( rc == 4 )) && error "$ERR , network failure!" && exit 60 + (( rc == 8 )) && error "$ERR , server issued an error response!" && exit 60 if (( rc != 0 )); then if (( rc != 22 )) && (( rc != 56 )); then - error "Failed to download $LOC, reason: $rc" && exit 60 + error "$ERR , reason: $rc" && exit 60 fi SUM="skip" else @@ -171,9 +172,11 @@ 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 == 8 )) && error "Failed to download $LOC , server issued an error response!" && exit 60 - (( rc != 0 )) && error "Failed to download $LOC , reason: $rc" && exit 60 + + ERR="Failed to download $LOC" + (( rc == 4 )) && error "$ERR , network failure!" && exit 60 + (( rc == 8 )) && error "$ERR , server issued an error response!" && exit 60 + (( rc != 0 )) && error "$ERR , reason: $rc" && exit 60 tar --extract --file="$PAT" --directory="$(dirname "$RD")"/. "$(basename "$RD")" rm "$PAT" @@ -226,6 +229,8 @@ rm -rf "$TMP" && mkdir -p "$TMP" info "Install: Downloading $BASE.pat..." MSG="Downloading DSM" +ERR="Failed to download $URL" + html "$MSG..." PAT="/$BASE.pat" @@ -246,13 +251,14 @@ 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 == 8 )) && error "Failed to download $URL , server issued an error response!" && exit 69 - (( rc != 0 )) && error "Failed to download $URL , reason: $rc" && exit 69 + + (( rc == 4 )) && error "$ERR , network failure!" && exit 69 + (( rc == 8 )) && error "$ERR , server issued an error response!" && exit 69 + (( rc != 0 )) && error "$ERR , reason: $rc" && exit 69 fi -[ ! -s "$PAT" ] && error "Failed to download $URL" && exit 69 +[ ! -s "$PAT" ] && error "$ERR" && exit 69 SIZE=$(stat -c%s "$PAT")