fix: checksum file name

This commit is contained in:
Radostin Emanuilov 2024-08-23 22:04:19 +01:00
parent 5588420eaa
commit 967eb0a9da
No known key found for this signature in database

View File

@ -7,16 +7,16 @@ set -e
if [ ! -f $BASE_DISK_FILEPATH ]; then if [ ! -f $BASE_DISK_FILEPATH ]; then
vmDiskFileURL="https://dl.rockylinux.org/pub/rocky/$ROCKY_VERSION/images/x86_64/$VM_DISK_FILE_TO_DOWNLOAD" vmDiskFileURL="https://dl.rockylinux.org/pub/rocky/$ROCKY_VERSION/images/x86_64/$VM_DISK_FILE_TO_DOWNLOAD"
checksumFileName="$VM_DISK_FILE_TO_DOWNLOAD.CHECKSUM" checksumFile="$BASE_DISK_FILEPATH.CHECKSUM"
vmDiskFileChecksumURL="https://dl.rockylinux.org/pub/rocky/$ROCKY_VERSION/images/x86_64/$checksumFileName" vmDiskFileChecksumURL="https://dl.rockylinux.org/pub/rocky/$ROCKY_VERSION/images/x86_64/$checksumFileName"
echo "--- Downloading $vmDiskFileURL ---" echo "--- Downloading $vmDiskFileURL ---"
curl $vmDiskFileURL -o $BASE_DISK_FILEPATH curl $vmDiskFileURL -o $BASE_DISK_FILEPATH
echo "--- Downloading $vmDiskFileChecksumURL ---" echo "--- Downloading $vmDiskFileChecksumURL ---"
curl $vmDiskFileChecksumURL -o $OUTPUT_DIR$checksumFileName curl $vmDiskFileChecksumURL -o $checksumFile
echo "--- Checking checksum ---" echo "--- Checking checksum ---"
expectedChecksum=$(cat $OUTPUT_DIR/$checksumFileName | awk 'NR==2 {print $4}') expectedChecksum=$(cat $checksumFile | awk 'NR==2 {print $4}')
if [ $(sha256sum $BASE_DISK_FILEPATH | awk '{print $1}') == "$expectedChecksum" ]; then if [ $(sha256sum $BASE_DISK_FILEPATH | awk '{print $1}') == "$expectedChecksum" ]; then
echo "--- CHECKSUM CONFIRMED ---" echo "--- CHECKSUM CONFIRMED ---"
else else