mirror of
https://github.com/quickemu-project/quickemu.git
synced 2024-09-20 00:02:03 +02:00
Remove EDITION boiler plate from all get_() functions
This commit is contained in:
parent
8050abc6f0
commit
1dc780b9e2
103
quickget
103
quickget
|
@ -9,15 +9,11 @@
|
||||||
# 5. Update make_vm_config() - add any *required* new OS tweaks
|
# 5. Update make_vm_config() - add any *required* new OS tweaks
|
||||||
# 6. Create a get_newos() function - that does something like this:
|
# 6. Create a get_newos() function - that does something like this:
|
||||||
# function get_newos() {
|
# function get_newos() {
|
||||||
# local EDITION=""
|
# local EDITION="${1:-}"
|
||||||
# local HASH=""
|
# local HASH=""
|
||||||
# local ISO=""
|
# local ISO=""
|
||||||
# local URL=""
|
# local URL=""
|
||||||
#
|
#
|
||||||
# if [ -n "${1}" ]; then
|
|
||||||
# EDITION="${1}"
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# URL="https://www.newos.org/download/${RELEASE}/${EDITION}"
|
# URL="https://www.newos.org/download/${RELEASE}/${EDITION}"
|
||||||
# ISO="newos-${RELEASE}-${EDITION}-amd64.iso"
|
# ISO="newos-${RELEASE}-${EDITION}-amd64.iso"
|
||||||
# web_get "${URL}/${ISO}" "${VM_PATH}"
|
# web_get "${URL}/${ISO}" "${VM_PATH}"
|
||||||
|
@ -770,15 +766,11 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_alma() {
|
function get_alma() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
URL="http://lon.mirror.rackspace.com/almalinux/${RELEASE}/isos/x86_64/"
|
URL="http://lon.mirror.rackspace.com/almalinux/${RELEASE}/isos/x86_64/"
|
||||||
ISO="AlmaLinux-${RELEASE}-x86_64-${EDITION}.iso"
|
ISO="AlmaLinux-${RELEASE}-x86_64-${EDITION}.iso"
|
||||||
HASH="$(wget -q -O- "${URL}/CHECKSUM" | grep \("${ISO}" | cut -d'\' -f4)"
|
HASH="$(wget -q -O- "${URL}/CHECKSUM" | grep \("${ISO}" | cut -d'\' -f4)"
|
||||||
|
@ -849,17 +841,13 @@ function get_archlinux() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_arcolinux() {
|
function get_arcolinux() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1:0:1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
URL="https://ant.seedhost.eu/arcolinux/iso/${RELEASE}"
|
URL="https://ant.seedhost.eu/arcolinux/iso/${RELEASE}"
|
||||||
ISO="arcolinux${EDITION}-${RELEASE}-x86_64.iso"
|
ISO="arcolinux${EDITION:0:1}-${RELEASE}-x86_64.iso"
|
||||||
HASH=$(wget -q -O- "${URL}/${ISO}.sha1" | cut -d' ' -f 1)
|
HASH=$(wget -q -O- "${URL}/${ISO}.sha1" | cut -d' ' -f 1)
|
||||||
web_get "${URL}/${ISO}" "${VM_PATH}"
|
web_get "${URL}/${ISO}" "${VM_PATH}"
|
||||||
check_hash "${ISO}" "${HASH}"
|
check_hash "${ISO}" "${HASH}"
|
||||||
|
@ -877,15 +865,11 @@ function get_cachyos() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_debian() {
|
function get_debian() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${RELEASE} in
|
case ${RELEASE} in
|
||||||
11.2.0) URL="https://cdimage.debian.org/debian-cd/${RELEASE}-live/amd64/iso-hybrid";;
|
11.2.0) URL="https://cdimage.debian.org/debian-cd/${RELEASE}-live/amd64/iso-hybrid";;
|
||||||
*) URL="https://cdimage.debian.org/cdimage/archive/${RELEASE}-live/amd64/iso-hybrid/"
|
*) URL="https://cdimage.debian.org/cdimage/archive/${RELEASE}-live/amd64/iso-hybrid/"
|
||||||
|
@ -929,17 +913,13 @@ function get_elementary() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_fedora() {
|
function get_fedora() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local JSON=""
|
local JSON=""
|
||||||
local URL=""
|
local URL=""
|
||||||
local VARIANT=""
|
local VARIANT=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${EDITION} in
|
case ${EDITION} in
|
||||||
Server|Silverblue|Workstation) VARIANT="${EDITION}";;
|
Server|Silverblue|Workstation) VARIANT="${EDITION}";;
|
||||||
*) VARIANT="Spins";;
|
*) VARIANT="Spins";;
|
||||||
|
@ -969,15 +949,11 @@ function get_freebsd() {
|
||||||
|
|
||||||
function get_garuda() {
|
function get_garuda() {
|
||||||
local BRANCH=""
|
local BRANCH=""
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${EDITION} in
|
case ${EDITION} in
|
||||||
cinnamon|mate) BRANCH="community";;
|
cinnamon|mate) BRANCH="community";;
|
||||||
*) BRANCH="garuda";;
|
*) BRANCH="garuda";;
|
||||||
|
@ -1004,15 +980,11 @@ function get_gentoo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_ghostbsd() {
|
function get_ghostbsd() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
local HASH=""
|
local HASH=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${EDITION} in
|
case ${EDITION} in
|
||||||
mate) ISO="GhostBSD-${RELEASE}.iso";;
|
mate) ISO="GhostBSD-${RELEASE}.iso";;
|
||||||
xfce) ISO="GhostBSD-${RELEASE}-XFCE.iso";;
|
xfce) ISO="GhostBSD-${RELEASE}-XFCE.iso";;
|
||||||
|
@ -1026,15 +998,11 @@ function get_ghostbsd() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_haiku() {
|
function get_haiku() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
local HASH=""
|
local HASH=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
URL="https://cdn.haiku-os.org/haiku-release/${RELEASE}"
|
URL="https://cdn.haiku-os.org/haiku-release/${RELEASE}"
|
||||||
ISO="haiku-${RELEASE}-${EDITION}-anyboot.iso"
|
ISO="haiku-${RELEASE}-${EDITION}-anyboot.iso"
|
||||||
HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | grep "${ISO}" | cut -d' ' -f4)
|
HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | grep "${ISO}" | cut -d' ' -f4)
|
||||||
|
@ -1085,15 +1053,11 @@ function get_kolibrios() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_linuxmint() {
|
function get_linuxmint() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
URL="https://mirror.bytemark.co.uk/linuxmint/stable/${RELEASE}"
|
URL="https://mirror.bytemark.co.uk/linuxmint/stable/${RELEASE}"
|
||||||
ISO="linuxmint-${RELEASE}-${EDITION}-64bit.iso"
|
ISO="linuxmint-${RELEASE}-${EDITION}-64bit.iso"
|
||||||
HASH=$(wget -q -O- "${URL}/${RELEASE}/sha256sum.txt" | grep "${ISO}" | cut -d' ' -f1)
|
HASH=$(wget -q -O- "${URL}/${RELEASE}/sha256sum.txt" | grep "${ISO}" | cut -d' ' -f1)
|
||||||
|
@ -1194,15 +1158,11 @@ function get_manjaro() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_mxlinux() {
|
function get_mxlinux() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${EDITION} in
|
case ${EDITION} in
|
||||||
xfce)
|
xfce)
|
||||||
URL="https://sourceforge.net/projects/mx-linux/files/Final/Xfce"
|
URL="https://sourceforge.net/projects/mx-linux/files/Final/Xfce"
|
||||||
|
@ -1248,15 +1208,11 @@ function get_netbsd() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_nixos() {
|
function get_nixos() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
URL="https://channels.nixos.org/nixos-${RELEASE}"
|
URL="https://channels.nixos.org/nixos-${RELEASE}"
|
||||||
ISO="latest-nixos-${EDITION}-x86_64-linux.iso"
|
ISO="latest-nixos-${EDITION}-x86_64-linux.iso"
|
||||||
HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1)
|
HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1)
|
||||||
|
@ -1327,15 +1283,11 @@ function get_oraclelinux() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_popos() {
|
function get_popos() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
URL=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq ".url")
|
URL=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq ".url")
|
||||||
URL="${URL//\"/}"
|
URL="${URL//\"/}"
|
||||||
ISO=$(echo "${URL}" | sed -e "s/.*\/\([^\/]*\)$/\1/")
|
ISO=$(echo "${URL}" | sed -e "s/.*\/\([^\/]*\)$/\1/")
|
||||||
|
@ -1347,16 +1299,12 @@ function get_popos() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_regolith() {
|
function get_regolith() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local SUBDIR=""
|
local SUBDIR=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${EDITION} in
|
case ${EDITION} in
|
||||||
1.6.0) SUBDIR="release-release-${RELEASE}-${RELEASE}_standard-${EDITION}";;
|
1.6.0) SUBDIR="release-release-${RELEASE}-${RELEASE}_standard-${EDITION}";;
|
||||||
2.0.0) SUBDIR="regolith-linux-2.0-${RELEASE}-latest";;
|
2.0.0) SUBDIR="regolith-linux-2.0-${RELEASE}-latest";;
|
||||||
|
@ -1373,15 +1321,11 @@ function get_regolith() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_rockylinux() {
|
function get_rockylinux() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
URL="https://download.rockylinux.org/pub/rocky/${RELEASE}/isos/x86_64"
|
URL="https://download.rockylinux.org/pub/rocky/${RELEASE}/isos/x86_64"
|
||||||
ISO="Rocky-${RELEASE}-x86_64-${EDITION}.iso"
|
ISO="Rocky-${RELEASE}-x86_64-${EDITION}.iso"
|
||||||
HASH=$(wget -q -O- "${URL}/CHECKSUM" | grep "SHA256" | grep "${ISO}" | cut -d' ' -f4)
|
HASH=$(wget -q -O- "${URL}/CHECKSUM" | grep "SHA256" | grep "${ISO}" | cut -d' ' -f4)
|
||||||
|
@ -1413,15 +1357,11 @@ function get_slackware() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_solus() {
|
function get_solus() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${EDITION} in
|
case ${EDITION} in
|
||||||
mate|gnome)
|
mate|gnome)
|
||||||
EDITION=${EDITION^^};;
|
EDITION=${EDITION^^};;
|
||||||
|
@ -1503,15 +1443,12 @@ function get_ubuntu() {
|
||||||
|
|
||||||
function get_void() {
|
function get_void() {
|
||||||
local DATE=""
|
local DATE=""
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL="https://alpha.de.repo.voidlinux.org/live/current"
|
local URL="https://alpha.de.repo.voidlinux.org/live/current"
|
||||||
|
|
||||||
DATE=$(wget -q -O- "${URL}/sha256sum.txt" | head -n1 | cut -d'.' -f1 | cut -d'-' -f4)
|
DATE=$(wget -q -O- "${URL}/sha256sum.txt" | head -n1 | cut -d'.' -f1 | cut -d'-' -f4)
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
case ${EDITION} in
|
case ${EDITION} in
|
||||||
glibc) ISO="void-live-x86_64-${DATE}.iso";;
|
glibc) ISO="void-live-x86_64-${DATE}.iso";;
|
||||||
musl) ISO="void-live-x86_64-musl-${DATE}.iso";;
|
musl) ISO="void-live-x86_64-musl-${DATE}.iso";;
|
||||||
|
@ -1525,14 +1462,10 @@ function get_void() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_zorin() {
|
function get_zorin() {
|
||||||
local EDITION=""
|
local EDITION="${1:-}"
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
if [ -n "${1}" ]; then
|
|
||||||
EDITION="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Parse out the iso URL from the redirector
|
# Parse out the iso URL from the redirector
|
||||||
URL=$(wget -q -S -O- --max-redirect=0 "https://zrn.co/${RELEASE}${EDITION}" 2>&1 | grep Location | cut -d' ' -f4)
|
URL=$(wget -q -S -O- --max-redirect=0 "https://zrn.co/${RELEASE}${EDITION}" 2>&1 | grep Location | cut -d' ' -f4)
|
||||||
ISO="${URL##*/}"
|
ISO="${URL##*/}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user