DistroHopper/public/fedora
2026-04-17 00:19:15 +02:00

37 lines
1.4 KiB
Text

# Template file for 'fedora'
OSNAME="fedora"
PRETTY="Fedora"
BASEDOF="-"
DESCRIPTION="Innovative platform for hardware, clouds, and containers, built with love by you"
HOMEPAGE="https://www.fedoraproject.org"
CREDENTIALS="-"
RELEASES="44_Beta 43 42"
EDITIONS="Xfce Workstation Sway Silverblue Server Sericea Onyx MiracleWM Mate LXQt LXDE Kinoite KDE_Mobile KDE i3 COSMIC-Atomic COSMIC Cinnamon Budgie Atomic"
function get_() {
local HASH=""
local ISO=""
local JSON=""
local URL=""
local VARIANT=""
case ${EDITION} in
Server|Kinoite|Onyx|Silverblue|Sericea|Workstation) VARIANT="${EDITION}";;
*) VARIANT="Spins";;
esac
# The naming of 41 Beta with a space is problematic so we replaced it with an underscore
# but we need to convert it back to a space for the URL search in the JSON
#shellcheck disable=SC2086
# if RELEASE contains an underscore, replace it with a space
if [[ "${RELEASE}" == *"_"* ]]; then
RELEASE="${RELEASE/_/ }"
fi
# shellcheck disable=SC2086
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select(.variant=="'${VARIANT}'" and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'" and (.link | endswith(".iso")))')
URL=$(echo "${JSON}" | jq -r '.link' | head -n1)
HASH=$(echo "${JSON}" | jq -r '.sha256' | head -n1)
echo "${URL} ${HASH}"
}