Refactor get_tails()

pull/373/head
Martin Wimpress 3 years ago
parent ea509ac5e0
commit 4bafb49e0a
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
  1. 12
      quickget

@ -1333,11 +1333,17 @@ function get_regolith() {
} }
function get_tails() { function get_tails() {
local ISO=""
local HASH=""
local RELEASE_JSON_URL=""
local RELEASE_JSON=""
local URL=""
validate_release "releases_tails" validate_release "releases_tails"
RELEASE_JSON_URL="https://tails.boum.org/install/v2/Tails/amd64/${RELEASE}/latest.json" RELEASE_JSON_URL="https://tails.boum.org/install/v2/Tails/amd64/${RELEASE}/latest.json"
RELEASE_JSON="$(wget -q -O- "$RELEASE_JSON_URL")" 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') 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') HASH=$(echo "${RELEASE_JSON}" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].sha256')
ISO=$(echo "${URL}" | sed -e "s/.*\/\([^\/]*\)$/\1/") ISO=$(echo "${URL}" | sed -e "s/.*\/\([^\/]*\)$/\1/")
web_get "${URL}" "${VM_PATH}" web_get "${URL}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}" check_hash "${ISO}" "${HASH}"

Loading…
Cancel
Save