fix: update get_ubuntu-server() to support 14.04 and 16.04

This commit is contained in:
Martin Wimpress 2024-04-28 13:26:38 +01:00
parent f034178810
commit 11ff193543
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
1 changed files with 8 additions and 6 deletions

View File

@ -2495,6 +2495,7 @@ function get_tuxedoos() {
function get_ubuntu-server() {
local HASH=""
local ISO=""
local NAME="live-server"
local URL=""
[[ $RELEASE = daily ]] && RELEASE=daily-live
if [[ "${RELEASE}" == "daily"* ]]; then
@ -2502,19 +2503,20 @@ function get_ubuntu-server() {
else
URL="https://releases.ubuntu.com/${RELEASE}"
fi
case "${RELEASE}" in
14*|16*) NAME="server";;
esac
if web_check "${URL}/SHA256SUMS"; then
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep 'live-server' | grep amd64 | grep iso)
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep "${NAME}" | grep amd64 | grep iso)
ISO=$(cut -d'*' -f2 <<<${DATA})
HASH=$(cut_1 <<<${DATA})
else
DATA=$(web_pipe "${URL}/MD5SUMS" | grep 'live-server' | grep amd64 | grep iso)
DATA=$(web_pipe "${URL}/MD5SUMS" | grep "${NAME}" | grep amd64 | grep iso)
ISO=$(cut -d' ' -f3 <<<${DATA})
HASH=$(cut_1 <<<${DATA})
fi
if [ -z $ISO ] || [ -z $HASH ]; then
echo "$(pretty_name $OS) ${RELEASE} is currently unavailable. Please select other OS/Release combination"
exit 1
fi
if [[ "${RELEASE}" == "daily"* ]] || [ "${RELEASE}" == "dvd" ]; then
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso"
make_vm_config "${OS}-devel.iso"