From ec082429ab35a45d8a362703c26932206b5b1747 Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Tue, 29 Nov 2022 23:00:51 +0300 Subject: scripts: avoid relying on spaces from sha1sum output --- resources/scripts/download/mrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'resources/scripts/download') diff --git a/resources/scripts/download/mrc b/resources/scripts/download/mrc index e51da9e5..2b33ddb9 100755 --- a/resources/scripts/download/mrc +++ b/resources/scripts/download/mrc @@ -35,7 +35,7 @@ download_image() echo "Downloading recovery image" curl "$_url" > "$_file.zip" - if [ "$(sha1sum ${_file}.zip)" = "${_sha1sum} ${_file}.zip" ]; then + if [ "$(sha1sum ${_file}.zip | awk '{print $1}')" = "${_sha1sum}" ]; then unzip -q "${_file}.zip" rm "${_file}.zip" echo "Checksum verification passed for recovery image." @@ -95,7 +95,7 @@ check_existing() _mrc_complete_hash="d18de1e3d52c0815b82ea406ca07897c56c65696" if [ -f mrc/haswell/mrc.bin ]; then printf 'found existing mrc.bin, checking its hash\n' - if [ "$(sha1sum mrc/haswell/mrc.bin)" = "${_mrc_complete_hash} mrc/haswell/mrc.bin" ]; then + if [ "$(sha1sum mrc/haswell/mrc.bin | awk '{print $1}')" = "${_mrc_complete_hash}" ]; then printf 'checksums matched, skipping redownloading image\n' return 0 else -- cgit v1.2.1