From 247b3d8a4ea8db5ccc4de4f5110f730f580d043e Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Sat, 9 Oct 2021 16:32:40 +0100 Subject: [PATCH] Only check Windows iso SHA1 if a SHA1 is available --- quickget | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/quickget b/quickget index 1e8aa6c..a9bdd19 100755 --- a/quickget +++ b/quickget @@ -526,17 +526,21 @@ function get_windows() { echo "Downloading ${WINDOWS_NAME}..." web_get "${DOWNLOAD_URL}" "${VM_PATH}" "${FILE_NAME}" - echo "${DOWNLOAD_SHA1} ${FILE_NAME}" > "${VM_PATH}/SHA1SUMS" - echo "Checking SHA1SUMS..." - cd "${VM_PATH}" - if ! sha1sum --check SHA1SUMS --ignore-missing --status; then - echo "ERROR! ${ISO} doesn't match ${VM_PATH}/SHA1SUMS. Try running 'quickget' again." - exit 1 - else - echo "All good." + # Windows 10 doesn't include a SHA1 sum + # Only check the integrity is SHA1 is available. + if [ -n "${DOWNLOAD_SHA1}" ]; then + echo "${DOWNLOAD_SHA1} ${FILE_NAME}" > "${VM_PATH}/SHA1SUMS" + echo "Checking SHA1SUMS..." + cd "${VM_PATH}" + if ! sha1sum --check SHA1SUMS --ignore-missing --status; then + echo "ERROR! ${ISO} doesn't match ${VM_PATH}/SHA1SUMS. Try running 'quickget' again." + exit 1 + else + echo "All good." + fi + cd .. fi - cd .. echo "Downloading virtio-win.iso..." web_get "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso" "${VM_PATH}"