Refactor get_android() to add create_vm() compatibility

pull/388/head
Martin Wimpress 3 years ago
parent 4f5752bb0d
commit 5ba5847d21
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
  1. 7
      quickget

@ -708,17 +708,14 @@ function get_android() {
JSON_REL=$(echo "${JSON_ALL}" | jq --arg ver "${OS}-${EDITION}-${RELEASE}" 'first(.pool.f[] | select((.n | startswith($ver)) and (.n | endswith(".iso"))))') JSON_REL=$(echo "${JSON_ALL}" | jq --arg ver "${OS}-${EDITION}-${RELEASE}" 'first(.pool.f[] | select((.n | startswith($ver)) and (.n | endswith(".iso"))))')
ISO=$(echo "${JSON_REL}" | jq -r .n) ISO=$(echo "${JSON_REL}" | jq -r .n)
HASH=$(echo "${JSON_REL}" | jq -r .hash.sha256) HASH=$(echo "${JSON_REL}" | jq -r .hash.sha256)
# Traverse the directories to find the .iso location # Traverse the directories to find the .iso location
for DIR in $(wget -q -O- ${URL} | grep -o -E '[0-9]{5}' | sort -ur); do for DIR in $(wget -q -O- "${URL}" | grep -o -E '[0-9]{5}' | sort -ur); do
if wget -q -O- "${URL}/${DIR}" | grep "${ISO}" &>/dev/null; then if wget -q -O- "${URL}/${DIR}" | grep "${ISO}" &>/dev/null; then
URL="${URL}/${DIR}" URL="${URL}/${DIR}"
break break
fi fi
done done
web_get "${URL}/${ISO}" "${VM_PATH}" echo "${URL}/${ISO} ${HASH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
} }
function get_archlinux() { function get_archlinux() {

Loading…
Cancel
Save