From ffac1da50303c773db1c27de4ffc5b88ec84d06c Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Wed, 23 Feb 2022 11:05:55 +0000 Subject: [PATCH] Refactor get_tails() to add create_vm() compatibility --- quickget | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/quickget b/quickget index 84fbc00..42266bf 100755 --- a/quickget +++ b/quickget @@ -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() {