From dc5cc54af5f3d8673eda17dac1be5e1741dbc0c5 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Mon, 21 Feb 2022 01:54:39 +0000 Subject: [PATCH] Refactor get_debian() --- quickget | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/quickget b/quickget index 518bcd8..0c55dda 100755 --- a/quickget +++ b/quickget @@ -841,27 +841,24 @@ function get_cachyos() { function get_debian() { local HASH="" + local HASHLINE="" local ISO="" local URL="" - local HASHLINE="" - local FREEDOM="" - validate_release "releases_debian" if [ "${1}" == "nonfree" ]; then RELEASE="${RELEASE}+nonfree" fi - case $RELEASE in - *+nonfree) URL="http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/current-live/amd64/iso-hybrid" ;; - *) URL="https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid";; - esac + case ${RELEASE} in + *+nonfree) URL="http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/current-live/amd64/iso-hybrid";; + *) URL="https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid";; + esac - HASHLINE=$(wget -q -O- ${URL}/SHA512SUMS |grep ${RELEASE}.iso) - ISO="$(echo ${HASHLINE} | awk '{print $NF}' )" - HASH=$(echo ${HASHLINE} | cut -d\ -f1) - + HASHLINE=$(wget -q -O- "${URL}/SHA512SUMS" | grep "${RELEASE}.iso") + ISO="$(echo "${HASHLINE}" | awk '{print $NF}')" + HASH=$(echo "${HASHLINE}" | cut -d'\' -f1) web_get "${URL}/${ISO}" "${VM_PATH}" check_hash "${ISO}" "${HASH}" make_vm_config "${ISO}"