diff --git a/cli/scripts/build_rsync.sh b/cli/scripts/build_rsync.sh index 4ef5cd2..0d9723b 100644 --- a/cli/scripts/build_rsync.sh +++ b/cli/scripts/build_rsync.sh @@ -56,12 +56,13 @@ fi if [[ "${verified}" -ne 1 ]]; then if [[ -n "${RSYNC_TARBALL_SHA256}" ]]; then echo "verifying sha256 for ${url}" - if command -v sha256sum >/dev/null 2>&1; then - echo "${RSYNC_TARBALL_SHA256} ${tmp}/rsync.tar.gz" | sha256sum -c - - elif command -v shasum >/dev/null 2>&1; then - echo "${RSYNC_TARBALL_SHA256} ${tmp}/rsync.tar.gz" | shasum -a 256 -c - + actual_sha256="$(sha256sum "${tmp}/rsync.tar.gz" | cut -d' ' -f1)" + if [[ "${actual_sha256}" == "${RSYNC_TARBALL_SHA256}" ]]; then + echo "${tmp}/rsync.tar.gz: OK" else - echo "build-rsync: need sha256sum or shasum for checksum verification" >&2 + echo "build-rsync: sha256 mismatch!" >&2 + echo " expected: ${RSYNC_TARBALL_SHA256}" >&2 + echo " actual: ${actual_sha256}" >&2 exit 2 fi else