Refactor get_garuda()
This commit is contained in:
parent
4bafb49e0a
commit
8ad252295b
28
quickget
28
quickget
@ -1400,17 +1400,16 @@ function get_ubuntu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_garuda() {
|
function get_garuda() {
|
||||||
|
local DATE=""
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local URL=""
|
local URL="http://mirrors.fossho.st/garuda/iso"
|
||||||
local REL_TYPE=""
|
local REL_TYPE=""
|
||||||
local LATEST_URL=""
|
local LATEST_URL=""
|
||||||
local HASH_URL=""
|
local HASH_URL=""
|
||||||
local GLDL="http://mirrors.fossho.st/garuda/iso"
|
|
||||||
|
|
||||||
validate_release "releases_garuda"
|
validate_release "releases_garuda"
|
||||||
|
|
||||||
# Part of the path is different for a couple of community releases vs the supported garuda ones
|
|
||||||
case ${RELEASE} in
|
case ${RELEASE} in
|
||||||
mate|cinnamon)
|
mate|cinnamon)
|
||||||
REL_TYPE="community";;
|
REL_TYPE="community";;
|
||||||
@ -1418,20 +1417,15 @@ function get_garuda() {
|
|||||||
REL_TYPE="garuda";;
|
REL_TYPE="garuda";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# need to follow daily releases and use contents of SHA sums file
|
# Follow daily releases and use SHA hash file to derive .iso and date
|
||||||
# to derive the filename and date
|
LATEST_URL="${URL}/latest/${REL_TYPE}/${RELEASE}/latest.iso.sha256"
|
||||||
LATEST_URL="${GLDL}/latest/${REL_TYPE}/${RELEASE}/latest.iso.sha256"
|
HASH_URL="$(wget -q -O- "${LATEST_URL}")"
|
||||||
HASH_URL="$(wget -q -O- ${LATEST_URL})"
|
ISO="$(echo "${HASH_URL}" | awk '{print $NF}')"
|
||||||
ISO="$(echo ${HASH_URL} | awk '{print $NF}' )"
|
HASH=$(echo "${HASH_URL}" | cut -d' ' -f1)
|
||||||
HASH=$(echo "${HASH_URL}" | cut -d\ -f1)
|
DATE=$(echo "${ISO}" | awk -F'-' '{print $NF}' | cut -d'.' -f1)
|
||||||
LDATE=$(echo "${ISO}" | awk -F'-' '{print $NF}' |cut -d'.' -f1) #
|
URL="${URL}/${REL_TYPE}/${RELEASE}/${DATE}"
|
||||||
URL="${GLDL}/${REL_TYPE}/${RELEASE}/${LDATE}"
|
web_get "${URL}/${ISO}" "${VM_PATH}"
|
||||||
|
check_hash "${ISO}" "${HASH}"
|
||||||
#web_get "${URL}/${ISO}" "${VM_PATH}"
|
|
||||||
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-${RELEASE}.iso"
|
|
||||||
#if [ -n "${HASH}" ]; then
|
|
||||||
# check_hash "${ISO}" "${HASH}"
|
|
||||||
#fi
|
|
||||||
make_vm_config "${OS}-${RELEASE}.iso"
|
make_vm_config "${OS}-${RELEASE}.iso"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user