Refactor get_tails() to add create_vm() compatibility

This commit is contained in:
Martin Wimpress 2022-02-23 11:05:55 +00:00
parent fa49bf2e0d
commit ffac1da503
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3

View File

@ -1118,19 +1118,14 @@ function get_solus() {
function get_tails() {
local ISO=""
local JSON=""
local HASH=""
local RELEASE_JSON_URL=""
local RELEASE_JSON=""
local URL=""
RELEASE_JSON_URL="https://tails.boum.org/install/v2/Tails/amd64/${RELEASE}/latest.json"
RELEASE_JSON="$(wget -q -O- "${RELEASE_JSON_URL}")"
URL=$(echo "${RELEASE_JSON}" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].url')
HASH=$(echo "${RELEASE_JSON}" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].sha256')
ISO="${URL##*/}"
web_get "${URL}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
JSON="$(wget -q -O- "https://tails.boum.org/install/v2/Tails/amd64/${RELEASE}/latest.json")"
URL=$(echo "${JSON}" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].url')
HASH=$(echo "${JSON}" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].sha256')
echo "${URL} ${HASH}"
}
function get_ubuntu() {