Refactor get_void()

This commit is contained in:
Martin Wimpress 2022-02-21 02:01:13 +00:00
parent bee4d52457
commit 71c7542dcb
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
1 changed files with 7 additions and 22 deletions

View File

@ -1093,32 +1093,17 @@ function get_openbsd() {
function get_void() {
local HASH=""
local ISO=""
local URL=""
local HASH_URL=""
local URL="https://alpha.de.repo.voidlinux.org/live/current"
validate_release "releases_void"
DATE=$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | awk 'NR == 1' |cut -d'.' -f1| cut -d'-' -f4)
URL="https://alpha.de.repo.voidlinux.org/live/current"
DATE=$(wget -q -O- "${URL}/sha256sum.txt" | head -n1 | cut -d'.' -f1 | cut -d'-' -f4)
case ${RELEASE} in
base)
ISO="void-live-x86_64-${DATE}.iso";;
musl)
ISO="void-live-x86_64-musl-${DATE}.iso";;
xfce)
ISO="void-live-x86_64-${DATE}-xfce.iso";;
xfce-musl)
ISO="void-live-x86_64-musl-${DATE}-xfce.iso";;
esac
case ${RELEASE} in
base)
HASH="$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | grep "void-live-x86_64-${DATE}.iso" | cut -d' ' -f4)";;
musl)
HASH="$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | grep "void-live-x86_64-musl-${DATE}.iso" | cut -d' ' -f4)";;
xfce)
HASH="$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | grep "void-live-x86_64-${DATE}-xfce.iso" | cut -d' ' -f4)";;
xfce-musl)
HASH="$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | grep "void-live-x86_64-musl-${DATE}.iso" | cut -d' ' -f4)";;
base) ISO="void-live-x86_64-${DATE}.iso";;
musl) ISO="void-live-x86_64-musl-${DATE}.iso";;
xfce) ISO="void-live-x86_64-${DATE}-xfce.iso";;
xfce-musl) ISO="void-live-x86_64-musl-${DATE}-xfce.iso";;
esac
HASH="$(wget -q -O- "${URL}/sha256sum.txt" | grep "${ISO}" | cut -d' ' -f4)"
web_get "${URL}/${ISO}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"