Refactor get_popos()

This commit is contained in:
Martin Wimpress 2022-02-22 15:29:46 +00:00
parent ee0a25472f
commit 45cdc5e217
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

@ -1285,11 +1285,9 @@ function get_popos() {
local ISO=""
local URL=""
URL=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq ".url")
URL="${URL//\"/}"
ISO=$(echo "${URL}" | sed -e "s/.*\/\([^\/]*\)$/\1/")
HASH=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq ".sha_sum")
HASH="${HASH//\"/}"
URL=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq -r .url)
ISO="${URL##*/}"
HASH=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq -r .sha_sum)
web_get "${URL}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"