Refactor get_alma()
This commit is contained in:
parent
15bb82501c
commit
bbdd66d7d1
15
quickget
15
quickget
@ -751,25 +751,20 @@ function get_android() {
|
|||||||
function get_alma() {
|
function get_alma() {
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
|
local ISOTYPE="minimal"
|
||||||
local URL=""
|
local URL=""
|
||||||
local VERSION=""
|
|
||||||
#local isotype=""
|
|
||||||
|
|
||||||
validate_release "releases_alma"
|
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
|
if [ -n "${1}" ]; then
|
||||||
ISOTYPE="${1}"
|
ISOTYPE="${1}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The mirror url returns 10 or so local mirrors with some kind or RR rotation/load balancing
|
# The mirror url returns 10 or so local mirrors with some kind or RR rotation/load balancing
|
||||||
# We'll just grab the first
|
# We'll just grab the first
|
||||||
|
URL=$(wget -qq -O- "https://mirrors.almalinux.org/isos/x86_64/${RELEASE}.html" | awk -F"<li>|</li>" '{for(i=2;i<=NF;i+=2) {print $i}}' RS="" | grep href | cut -d'"' -f2 | head -1)
|
||||||
URL=$(wget -qq -O- "https://mirrors.almalinux.org/isos/x86_64/${RELEASE}.html" | awk -F"<li>|</li>" '{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)"
|
||||||
#VM_PATH="${VM_PATH}"-${ISOTYPE}
|
|
||||||
ISO=AlmaLinux-${RELEASE}-x86_64-${ISOTYPE}.iso
|
|
||||||
HASH="$(wget -q -O- "${URL}/CHECKSUM" | grep \(${ISO} | cut -d\ -f4)"
|
|
||||||
web_get "${URL}/${ISO}" "${VM_PATH}"
|
web_get "${URL}/${ISO}" "${VM_PATH}"
|
||||||
check_hash "${ISO}" "${HASH}"
|
check_hash "${ISO}" "${HASH}"
|
||||||
make_vm_config "${ISO}"
|
make_vm_config "${ISO}"
|
||||||
@ -1910,7 +1905,7 @@ if [ -n "${2}" ]; then
|
|||||||
if [ "${OS}" == "alma" ]; then
|
if [ "${OS}" == "alma" ]; then
|
||||||
if [ -n "${3}" ]; then
|
if [ -n "${3}" ]; then
|
||||||
ISOTYPE="${3,,}"
|
ISOTYPE="${3,,}"
|
||||||
ISOTYPES=(minimal dvd ) # boot) # a step too far
|
ISOTYPES=(minimal dvd)
|
||||||
if [[ ! ${ISOTYPES[*]} =~ ${ISOTYPE} ]]; then
|
if [[ ! ${ISOTYPES[*]} =~ ${ISOTYPE} ]]; then
|
||||||
echo "iso ${ISOTYPE} is not supported:"
|
echo "iso ${ISOTYPE} is not supported:"
|
||||||
for ISOTYPE in "${ISOTYPES[@]}"; do
|
for ISOTYPE in "${ISOTYPES[@]}"; do
|
||||||
|
Loading…
Reference in New Issue
Block a user