# Template file for 'freebsd' OSNAME="freebsd" PRETTY="FreeBSD" LOGO="" ICON="freebsd.svg" ICON_ONLINE="" CATEGORY="advanced" BASEDOF="-" DESCRIPTION="Operating system used to power modern servers, desktops, and embedded platforms" HOMEPAGE="https://www.freebsd.org" CREDENTIALS="-" GPG="" RSS="" DW="" MAGNET="" MAGNET_PREFERRED="" TORRENT="" CHAT="" GUEST="freebsd" RELEASES="15.2-RC1 15.1-RELEASE 15.0-RELEASE 14.5-RELEASE 14.4-RELEASE" EDITIONS="disc1 dvd1" EDITIONS_LIST="disc1 dvd1" QEMU_ARCH="amd64" releases_() { # List available release directories (RELEASE and RC/BETA), newest first. web_pipe "https://download.freebsd.org/ftp/releases/amd64/amd64/" \ | grep -Eo 'href="[0-9.]+-(RELEASE|RC[0-9]+)' \ | sed 's/href="//' \ | sort -rV | uniq } editions_() { echo disc1 dvd1 } get_() { local HASH="" local ISO="FreeBSD-${RELEASE}-amd64-${EDITION}.iso" local VER="${RELEASE%%-*}" local URL="https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/${VER}" HASH=$(web_pipe "${URL}/CHECKSUM.SHA256-FreeBSD-${RELEASE}-amd64" | grep "${ISO}" | grep -v ".xz" | cut -d' ' -f4) echo "${URL}/${ISO} ${HASH}" } releases_() { # Releases parsed at generation time — no network access needed. echo "${RELEASES}" } editions_() { # Editions parsed at generation time — no network access needed. local _scoped="" if [ -n "${RELEASE:-}" ] && declare -F _release_editions_ >/dev/null; then _scoped=$(_release_editions_ "${ARCH:-}|${RELEASE}") fi if [ -n "${_scoped}" ]; then echo "${_scoped}" return 0 fi local _per_arch="EDITIONS_${ARCH:-}" if [ -n "${!_per_arch:-}" ]; then echo "${!_per_arch}" return 0 fi echo "${EDITIONS:-}" }