From bbdd66d7d10bef23dc2bac968d93b16c6446dc77 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Mon, 21 Feb 2022 01:51:49 +0000 Subject: [PATCH] Refactor get_alma() --- quickget | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/quickget b/quickget index ca24020..75c9bda 100755 --- a/quickget +++ b/quickget @@ -751,25 +751,20 @@ function get_android() { function get_alma() { local HASH="" local ISO="" + local ISOTYPE="minimal" local URL="" - local VERSION="" - #local isotype="" validate_release "releases_alma" - ISOTYPE="minimal" # boot is a step too far for now - needs setting install source to mirror tree ... nope if [ -n "${1}" ]; then ISOTYPE="${1}" fi # The mirror url returns 10 or so local mirrors with some kind or RR rotation/load balancing # We'll just grab the first - - URL=$(wget -qq -O- "https://mirrors.almalinux.org/isos/x86_64/${RELEASE}.html" | awk -F"
  • |
  • " '{for(i=2;i<=NF;i+=2) {print $i}}' RS="" |grep href|cut -d\" -f2|head -1) - - #VM_PATH="${VM_PATH}"-${ISOTYPE} - ISO=AlmaLinux-${RELEASE}-x86_64-${ISOTYPE}.iso - HASH="$(wget -q -O- "${URL}/CHECKSUM" | grep \(${ISO} | cut -d\ -f4)" + URL=$(wget -qq -O- "https://mirrors.almalinux.org/isos/x86_64/${RELEASE}.html" | awk -F"
  • |
  • " '{for(i=2;i<=NF;i+=2) {print $i}}' RS="" | grep href | cut -d'"' -f2 | head -1) + ISO="AlmaLinux-${RELEASE}-x86_64-${ISOTYPE}.iso" + HASH="$(wget -q -O- "${URL}/CHECKSUM" | grep \("${ISO}" | cut -d'\' -f4)" web_get "${URL}/${ISO}" "${VM_PATH}" check_hash "${ISO}" "${HASH}" make_vm_config "${ISO}" @@ -1910,7 +1905,7 @@ if [ -n "${2}" ]; then if [ "${OS}" == "alma" ]; then if [ -n "${3}" ]; then ISOTYPE="${3,,}" - ISOTYPES=(minimal dvd ) # boot) # a step too far + ISOTYPES=(minimal dvd) if [[ ! ${ISOTYPES[*]} =~ ${ISOTYPE} ]]; then echo "iso ${ISOTYPE} is not supported:" for ISOTYPE in "${ISOTYPES[@]}"; do