Enable the (existing) custom error message for the invalid checksum case
We add a `set +e` around the `sha256sum` invocation, otherwise the shell errors out instantly (because of the `set -e` at the top), so we have the chance to print out the custom error message. We `set -e` as soon as we grab the return value from `sha256sum`.
This commit is contained in:
parent
086d3edfc3
commit
862c52c48b
|
@ -141,12 +141,14 @@ fetch_params() {
|
|||
cat "${dlname}.part.1" "${dlname}.part.2" > "${dlname}"
|
||||
rm "${dlname}.part.1" "${dlname}.part.2"
|
||||
|
||||
set +e
|
||||
"$SHA256CMD" $SHA256ARGS -c <<EOF
|
||||
$expectedhash $dlname
|
||||
EOF
|
||||
|
||||
# Check the exit code of the shasum command:
|
||||
CHECKSUM_RESULT=$?
|
||||
set -e
|
||||
if [ $CHECKSUM_RESULT -eq 0 ]; then
|
||||
mv -v "$dlname" "$output"
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue