Skip to content

Commit

Permalink
More error handling
Browse files Browse the repository at this point in the history
Signed-off-by: unknown <Something Pink>
  • Loading branch information
unknown authored and unknown committed Jan 4, 2024
1 parent 5bf39a4 commit 5a16883
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/install-opentofu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,10 @@ install_standalone() {
else
REALSUM=$(sha256sum "${TEMPDIR}/${ZIPFILE}" | cut -f 1 -d ' ')
fi
if [ -z "${REALSUM}" ]; then
log_error "Checksum could not be calculated for ${TEMPDIR}/${ZIPFILE}."
return $TOFU_INSTALL_EXIT_CODE_INSTALL_FAILED
fi
EXPECTEDSUM=$(grep "${ZIPFILE}" "${TEMPDIR}/${SUMSFILE}" | cut -f 1 -d ' ')
if [ -z "${EXPECTEDSUM}" ]; then
log_error "No checksum found for ${ZIPFILE}."
Expand Down

0 comments on commit 5a16883

Please sign in to comment.