Refactor get_rocky()

This commit is contained in:
Martin Wimpress 2022-02-21 02:02:23 +00:00
parent ecb0afbcce
commit ddb1f30d4f
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
1 changed files with 8 additions and 8 deletions

View File

@ -1124,17 +1124,17 @@ function get_zorin() {
function get_rocky() {
local HASH=""
local ISO=""
local ISOTYPE="minimal"
local URL=""
local arch="x86_64"
local baseurl="https://download.rockylinux.org/pub/rocky/${RELEASE}/isos/${arch}"
validate_release "releases_rockylinux"
ISO="Rocky-${RELEASE}-${arch}-${ISOTYPE}.iso"
URL="${baseurl}/${ISO}"
HASH=$(wget -q -O- "${baseurl}/CHECKSUM" | grep "SHA256 (${ISO})" | grep -E -i -w -o '[0-9a-z]{64}')
web_get "${URL}" "${VM_PATH}"
if [ -n "${1}" ]; then
ISOTYPE="${1}"
fi
URL="https://download.rockylinux.org/pub/rocky/${RELEASE}/isos/x86_64"
ISO="Rocky-${RELEASE}-x86_64-${ISOTYPE}.iso"
HASH=$(wget -q -O- "${URL}/CHECKSUM" | grep "SHA256" | grep "${ISO}" | cut -d' ' -f4)
web_get "${URL}/${ISO}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
}