diff --git a/quickget b/quickget index f0e3258..adca109 100755 --- a/quickget +++ b/quickget @@ -1,4 +1,5 @@ #!/usr/bin/env bash +#shellcheck disable=SC1001,1083,2016,2046,2086,2155,2206,2207,2068,2071,2076,2162 export LC_ALL=C # Here the quick 'n dirty guide to adding a new OS to quickget @@ -17,161 +18,181 @@ export LC_ALL=C # local ISO="newos-${RELEASE}-${EDITION}-amd64.iso" # local URL="https://www.newos.org/download/${RELEASE}/${EDITION}" # -# HASH=$(wget -q -O- "${URL}/SHA512SUMS" | grep "${ISO}" | cut -d' ' -f1) +# HASH=$(wget -q -O- "${URL}/SHA512SUMS" | grep "${ISO}" | cut_1) # echo "${URL}/${ISO} ${HASH}" #} function cleanup() { - if [ -n "$(jobs -p)" ]; then - kill "$(jobs -p)" - fi + if [ -n "$(jobs -p)" ]; then + kill "$(jobs -p)" + fi } -if [ "${1}" == '--test-iso-url' ] || [ "${1}" == '-t' ]; then - test_iso_url="on" - if [ -n "$4" ]; then - set -- "$2" "$3" "$4" - elif [ -n "$3" ]; then - set -- "$2" "$3" - else - set -- "$2" - fi -elif [ "${1}" == '--show-iso-url' ] || [ "${1}" == '-u' ]; then - show_iso_url="on" - if [ -n "$4" ]; then - set -- "$2" "$3" "$4" - elif [ -n "$3" ]; then - set -- "$2" "$3" - else - set -- "$2" - fi -elif [ "${1}" == '--open-distro-homepage' ] || [ "${1}" == '-o' ]; then - open_distro_homepage="on" - set -- "$2" -elif [ "${1}" == '--show-distro-homepage' ] || [ "${1}" == '-s' ]; then - show_distro_homepage="on" - set -- "$2" -elif [ "${1}" == '--download-iso' ] || [ "${1}" == '-d' ]; then - download_iso="on" - if [ -n "$4" ]; then - set -- "$2" "$3" "$4" - elif [ -n "$3" ]; then - set -- "$2" "$3" - else - set -- "$2" - fi -fi +function os_info() { + local SIMPLE_NAME="" + local INFO="" + SIMPLE_NAME="${1}" + case ${SIMPLE_NAME} in + alma) INFO="Alma Linux|Fedora,RedHat||https://almalinux.org/|Community owned and governed, forever-free enterprise Linux distribution, focused on long-term stability, providing a robust production-grade platform. AlmaLinux OS is binary compatible with RHEL®.";; + alpine) INFO="Alpine Linux|Independent||https://alpinelinux.org/|Security-oriented, lightweight Linux distribution based on musl libc and busybox.";; + android) INFO="Android x86|Independent||https://www.android-x86.org/|Port Android Open Source Project to x86 platform.";; + antix) INFO="Antix|Debian||https://antixlinux.com/|Fast, lightweight and easy to install systemd-free linux live CD distribution based on Debian Stable for Intel-AMD x86 compatible systems.";; + artix) INFO="Artix Linux|Arch||https://artixlinux.org/|The Art of Linux. Simple. Fast. Systemd-free.";; + archlinux) INFO="Arch Linux|Independent||https://archlinux.org/|Lightweight and flexible Linux® distribution that tries to Keep It Simple.";; + archcraft) INFO="Archcraft|Arch||https://archcraft.io/|Yet another minimal Linux distribution, based on Arch Linux.";; + arcolinux) INFO="Arco Linux|Arch||https://arcolinux.com/|Is all about becoming an expert in linux.";; + athenaos) INFO="Athena OS|Arch||https://athenaos.org/|Offer a different experience than the most used pentesting distributions by providing only tools that fit with the user needs and improving the access to hacking resources and learning materials.";; + batocera) INFO="Batocera|Independent||https://batocera.org/|Retro-gaming distribution with the aim of turning any computer/nano computer into a gaming console during a game or permanently.";; + bazzite) INFO="bazzite|Fedora,SteamOS||https://github.com/ublue-os/bazzite/|Container native gaming and a ready-to-game SteamOS like.";; + blendos) INFO="BlendOS|Arch||https://blendos.co/|A seamless blend of all Linux distributions. Allows you to have an immutable, atomic and declarative Arch Linux system, with application support from several Linux distributions & Android.";; + bodhi) INFO="Bodhi|Debian,Ubuntu||https://www.bodhilinux.com/|Lightweight distribution featuring the fast & fully customizable Moksha Desktop.";; + bunsenlabs) INFO="Bunsenlab|Debian||https://www.bunsenlabs.org/|Light-weight and easily customizable Openbox desktop. The project is a community continuation of CrunchBang Linux.";; + cachyos) INFO="CachyOS|Arch||https://cachyos.org/|Designed to deliver lightning-fast speeds and stability, ensuring a smooth and enjoyable computing experience every time you use it.";; + centos-stream) INFO="CentOS Stream|Fedora,RedHat||https://www.centos.org/centos-stream/|Continuously delivered distro that tracks just ahead of Red Hat Enterprise Linux (RHEL) development, positioned as a midstream between Fedora Linux and RHEL.";; + chimeralinux) INFO="Chimera Linux|Independent|anon:chimera root:chimera|https://chimera-linux.org/|Modern, general-purpose non-GNU Linux distribution.";; + crunchbang++) INFO="#!++|Debian||https://www.crunchbangplusplus.org/|The classic minimal crunchbang feel, now with debian 12 bookworm.";; + debian) INFO="Debian|Independent||https://www.debian.org/|Complete Free Operating System with perfect level of ease of use and stability.";; + deepin) INFO="Deepin|Debian||https://www.deepin.org/|Beautiful UI design, intimate human-computer interaction, and friendly community environment make you feel at home.";; + devuan) INFO="Devuan|Debian||https://www.devuan.org/|Fork of Debian without systemd that allows users to reclaim control over their system by avoiding unnecessary entanglements and ensuring Init Freedom.";; + dragonflybsd) INFO="DragonFlyBSD|FreeBSD||https://www.dragonflybsd.org/|Provides an opportunity for the BSD base to grow in an entirely different direction from the one taken in the FreeBSD, NetBSD, and OpenBSD series.";; + easyos) INFO="EasyOS|Independent||https://easyos.org/|Experimental distribution designed from scratch to support containers.";; + edubuntu) INFO="Edubuntu|Ubuntu||https://www.edubuntu.org/|Stable, secure and privacy concious option for schools.";; + elementary) INFO="elementary OS|Debian,Ubuntu||https://elementary.io/|Thoughtful, capable, and ethical replacement for Windows and macOS.";; + endeavouros) INFO="EndeavourOS|Arch||https://endeavouros.com/|Provides an Arch experience without the hassle of installing it manually for both x86_64 and ARM systems.";; + endless) INFO="Endless OS|Debian||https://www.endlessos.org/os|Completely Free, User-Friendly Operating System Packed with Educational Tools, Games, and More.";; + fedora) INFO="Fedora|Independent||https://www.fedoraproject.org/|Innovative platform for hardware, clouds, and containers, built with love by you.";; + freebsd) INFO="FreeBSD|Independent||https://www.freebsd.org/|Operating system used to power modern servers, desktops, and embedded platforms.";; + freedos) INFO="FreeDOS|Independent||https://freedos.org/|DOS-compatible operating system that you can use to play classic DOS games, run legacy business software, or develop embedded systems.";; + garuda) INFO="Garuda Linux|Arch||https://garudalinux.org/|Feature rich and easy to use Linux distribution.";; + gentoo) INFO="Gentoo|Independent||https://www.gentoo.org/|Highly flexible, source-based Linux distribution.";; + ghostbsd) INFO="GhostBSD|FreeBSD||https://www.ghostbsd.org/|Simple, elegant desktop BSD Operating System.";; + haiku) INFO="Haiku|Independent||https://www.haiku-os.org/|Specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.";; + holoiso) INFO="SteamOS HoloISO|Arch,SteamOS||https://github.com/HoloISO/holoiso|Bring the Steam Decks SteamOS Holo redistribution and provide a close-to-official SteamOS experience.";; + kali) INFO="Kali|Debian||https://www.kali.org/|The most advanced Penetration Testing Distribution.";; + kdeneon) INFO="KDE Neon|Debian,Ubuntu||https://neon.kde.org/|Latest and greatest of KDE community software packaged on a rock-solid base.";; + kolibrios) INFO="KolibriOS|Independent||http://kolibrios.org/en/|Tiny yet incredibly powerful and fast operating system.";; + kubuntu) INFO="Kubuntu|Ubuntu||https://kubuntu.org/|Free, complete, and open-source alternative to Microsoft Windows and Mac OS X which contains everything you need to work, play, or share.";; + linuxlite) INFO="Linux Lite|Debian,Ubuntu||https://www.linuxliteos.com/|Your first simple, fast and free stop in the world of Linux.";; + linuxmint) INFO="Linux Mint|Debian,Ubuntu||https://linuxmint.com/|Designed to work out of the box and comes fully equipped with the apps most people need.";; + lmde) INFO="Linux Mint Debian Edition|Debian||https://www.linuxmint.com/download_lmde.php|Aims to be as similar as possible to Linux Mint, but without using Ubuntu. The package base is provided by Debian instead.";; + lubuntu) INFO="Lubuntu|Ubuntu||https://lubuntu.me/|Complete Operating System that ships the essential apps and services for daily use: office applications, PDF reader, image editor, music and video players, etc. Using lightwave lxde/lxqt.";; + mageia) INFO="Mageia|Independent||https://www.mageia.org/|Stable, secure operating system for desktop & server.";; + manjaro) INFO="Manjaro|Arch||https://manjaro.org/|Versatile, free, and open-source Linux operating system designed with a strong focus on safeguarding user privacy and offering extensive control over hardware.";; + mxlinux) INFO="MX Linux|Debian,Antix||https://mxlinux.org/|Designed to combine elegant and efficient desktops with high stability and solid performance.";; + netboot) INFO="netboot.xyz|iPXE||https://netboot.xyz/|Your favorite operating systems in one place.";; + netbsd) INFO="NetBSD|Independent||https://www.netbsd.org/|Free, fast, secure, and highly portable Unix-like Open Source operating system. It is available for a wide range of platforms, from large-scale servers and powerful desktop systems to handheld and embedded devices.";; + nixos) INFO="NixOS|Independent||https://nixos.org/|Linux distribution based on Nix package manager, tool that takes a unique approach to package management and system configuration.";; + macos) INFO="macOS|proprietary||https://www.apple.com/macos/|Work and play on your Mac are even more powerful. Elevate your presence on video calls. Access information in all-new ways. Boost gaming performance. And discover even more ways to personalize your Mac.";; + openbsd) INFO="OpenBSD|Independent||https://www.openbsd.org/|FREE, multi-platform 4.4BSD-based UNIX-like operating system. Our efforts emphasize portability, standardization, correctness, proactive security and integrated cryptography.";; + openindiana) INFO="OpenIndiana|Solaris,OpenSolaris||https://www.openindiana.org/|Community supported illumos-based operating system.";; + opensuse) INFO="openSUSE|Independent||https://www.opensuse.org/|The makers choice for sysadmins, developers and desktop users.";; + oraclelinux) INFO="Oracle Linux|RedHat||https://www.oracle.com/linux/|Linux with everything required to deploy, optimize, and manage applications on-premises, in the cloud, and at the edge.";; + parrotsec) INFO="Parrot Security|Debian|parrot:parrot|https://www.parrotsec.org/|Provides a huge arsenal of tools, utilities and libraries that IT and security professionals can use to test and assess the security of their assets in a reliable, compliant and reproducible way.";; + peppermint) INFO="PeppermintOS|Debian,Devuan||https://peppermintos.com/|Provides a user with the opportunity to build the system that best fits their needs. While at the same time providing a functioning OS with minimum hassle out of the box.";; + popos) INFO="Pop!_OS|Ubuntu||https://pop.system76.com/|Operating system for STEM and creative professionals who use their computer as a tool to discover and create.";; + porteus) INFO="Porteus|Slackware||http://www.porteus.org/|Complete linux operating system that is optimized to run from CD, USB flash drive, hard drive, or other bootable storage media.";; + primtux) INFO="PrimTux|Ubuntu||https://primtux.fr/|Upgrade for obsolete equipment and benefiting the school or educational environment in the spirit of education.";; + reactos) INFO="ReactOS|Independent||https://reactos.org/|Imagine running your favorite Windows applications and drivers in an open-source environment you can trust.";; + rebornos) INFO="RebornOS|Arch||https://rebornos.org/|Aiming to make Arch Linux as user friendly as possible by providing interface solutions to things you normally have to do in a terminal.";; + rockylinux) INFO="Rocky Linux|RedHat||https://rockylinux.org/|Open-source enterprise operating system designed to be 100% bug-for-bug compatible with Red Hat Enterprise Linux®.";; + siduction) INFO="Siduction|Debian||https://siduction.org/|Operating system based on the Linux kernel and the GNU project. In addition, there are applications and libraries from Debian.";; + slackware) INFO="Slackware|Independent||http://www.slackware.com/|Advanced Linux operating system, designed with the twin goals of ease of use and stability as top priorities.";; + slax) INFO="Slax|Debian Slackware||https://www.slax.org/|Compact, fast, and modern Linux operating system that combines sleek design with modular approach. With the ability to run directly from a USB flash drive without the need for installation, Slax is truly portable and fits easily in your pocket.";; + slint) INFO="Slint|Slackware||https://slint.fr/|Slint is an easy-to-use, versatile, blind-friendly Linux distribution for 64-bit computers. Slint is based on Slackware and borrows tools from Salix. Maintainer: Didier Spaier.";; + slitaz) INFO="SliTaz|Independent||https://www.slitaz.org/en/|Simple, fast and low resource Linux OS for servers & desktops.";; + solus) INFO="Solus|Independent||https://getsol.us/|Designed for home computing. Every tweak enables us to deliver a cohesive computing experience.";; + sparkylinux) INFO="SparkyLinux|Debian||https://sparkylinux.org/|Fast, lightweight and fully customizable operating system which offers several versions for different use cases.";; + spirallinux) INFO="Spiral Linux|Debian||https://spirallinux.github.io/|Selection of Linux spins built from Debian GNU/Linux, with a focus on simplicity and out-of-the-box usability across all the major desktop environments.";; + tails) INFO="Tails|Debian||https://tails.net/|Portable operating system that protects against surveillance and censorship.";; + tinycore) INFO="Tiny Core Linux|Independent||http://www.tinycorelinux.net/|Highly modular based system with community build extensions.";; + trisquel) INFO="Trisquel|Debian,Ubuntu||https://trisquel.info/|Fully free operating system for home users, small enterprises and educational centers.";; + truenas-core) INFO="TrueNAS Core|FreeBSD||https://www.truenas.com/truenas-core/|World’s most popular storage OS because it gives you the power to build your own professional-grade storage system to use in a variety of data-intensive applications without any software costs.";; + truenas-scale) INFO="TrueNAS Scale|Debian||https://www.truenas.com/truenas-scale/|Open Source Hyperconverged Infrastructure (HCI) solution. In addition to powerful scale-out storage capabilities, SCALE adds Linux Containers and VMs (KVM) so apps run closer to data.";; + ubuntu) INFO="Ubuntu|Debian||https://ubuntu.com/|Complete desktop Linux operating system, freely available with both community and professional support.";; + ubuntu-budgie) INFO="Ubuntu Budgie|Ubuntu||https://ubuntubudgie.org/|Community developed distribution, integrating the Budgie Desktop Environment with Ubuntu at its core.";; + ubuntucinnamon) INFO="Ubuntu Cinnamon|Ubuntu||https://ubuntucinnamon.org/|Community-driven, featuring Linux Mint’s Cinnamon Desktop with Ubuntu at the core, packed fast and full of features, here is the most traditionally modern desktop you will ever love.";; + ubuntukylin) INFO="Ubuntu Kylin|Ubuntu||https://ubuntukylin.com/|Universal desktop operating system for personal computers, laptops, and embedded devices. It is dedicated to bringing a smarter user experience to users all over the world.";; + ubuntu-mate) INFO="Ubuntu MATE|Ubuntu||https://ubuntu-mate.org/|Stable, easy-to-use operating system with a configurable desktop environment. It is ideal for those who want the most out of their computers and prefer a traditional desktop metaphor. Using Mate desktop.";; + ubuntu-server) INFO="Ubuntu Server|Ubuntu||https://ubuntu.com/server|Brings economic and technical scalability to your datacentre, public or private. Whether you want to deploy an OpenStack cloud, a Kubernetes cluster or a 50,000-node render farm, Ubuntu Server delivers the best value scale-out performance available.";; + ubuntustudio) INFO="Ubuntu Studio|Ubuntu||https://ubuntustudio.org/|Comes preinstalled with a selection of the most common free multimedia applications available, and is configured for best performance for various purposes: Audio, Graphics, Video, Photography and Publishing.";; + ubuntu-unity) INFO="Ubuntu Unity|Ubuntu||https://ubuntuunity.org/|Flavor of Ubuntu featuring the Unity7 desktop environment (the default desktop environment used by Ubuntu from 2010-2017).";; + vanillaos) INFO="Vanilla OS|Debian,Ubuntu||https://vanillaos.org/|Designed to be a reliable and productive operating system for your daily work.";; + void) INFO="Void Linux|Independent|anon:voidlinux|https://voidlinux.org/|General purpose operating system. Its package system allows you to quickly install, update and remove software; software is provided in binary packages or can be built directly from sources.";; + vxlinux) INFO="VX Linux|Void||https://vxlinux.org/|Pre-configured, secure systemd-free Plasma desktop with focus on convenience, performance and simplicity. Based on the excellent Void Linux.";; + whonix) INFO="Whonix|Debian||https://www.whonix.org/|Superior Internet Privacy with Whonix™ As handy as an app - delivering maximum anonymity and security.";; + windows) INFO="Windows|proprietary||https://www.microsoft.com/en-us/windows/|Whether you’re gaming, studying, running a business, or running a household, Windows helps you get it done.";; + windows-server) INFO="Windows Server|proprietary||https://www.microsoft.com/en-us/windows-server/|Platform for building an infrastructure of connected applications, networks, and web services.";; + xerolinux) INFO="XeroLinux|Arch||https://xerolinux.xyz/|Arch-Based Distro, that provides you with an easy way to install Arch and a well optimized, beautifully Customized Plasma Desktop, that you can later shape to suite your needs!";; + xubuntu) INFO="Xubuntu|Ubuntu||https://xubuntu.org/|Elegant and easy to use operating system. Xubuntu comes with Xfce, which is a stable, light and configurable desktop environment.";; + zorin) INFO="Zorin OS|Ubuntu||https://zorin.com/os/|Alternative to Windows and macOS designed to make your computer faster, more powerful, secure, and privacy-respecting.";; + esac + echo "${INFO}" +} function pretty_name() { - local SIMPLE_NAME="" - local PRETTY_NAME="" - SIMPLE_NAME="${1}" - case ${SIMPLE_NAME} in - agarimos) PRETTY_NAME="AgarimOS";; - alma) PRETTY_NAME="Alma Linux";; - alpine) PRETTY_NAME="Alpine Linux";; - android) PRETTY_NAME="Android x86";; - archlinux) PRETTY_NAME="Arch Linux";; - archcraft) PRETTY_NAME="Archcraft";; - arcolinux) PRETTY_NAME="Arco Linux";; - artixlinux) PRETTY_NAME="Artix Linux";; - atheanos) PRETTY_NAME="Athena OS";; - biglinux) PRETTY_NAME="BigLinux";; - blendos) PRETTY_NAME="BlendOS";; - bodhi) PRETTY_NAME="Bodhi Linux";; - cachyos) PRETTY_NAME="CachyOS";; - centos-stream) PRETTY_NAME="CentOS Stream";; - cereus) PRETTY_NAME="Cereus Linux";; - chimera) PRETTY_NAME="Chimera Linux";; - crunchbang++) PRETTY_NAME="Crunchbangplusplus";; - devuan) PRETTY_NAME="Devuan";; - dietpi) PRETTY_NAME="DietPi";; - dragonflybsd) PRETTY_NAME="DragonFlyBSD";; - easyos) PRETTY_NAME="EasyOS";; - elementary) PRETTY_NAME="elementary OS";; - endeavouros) PRETTY_NAME="EndeavourOS";; - endless) PRETTY_NAME="Endless OS";; - freebsd) PRETTY_NAME="FreeBSD";; - freedos) PRETTY_NAME="FreeDOS";; - fvoid) PRETTY_NAME="F-Void";; - gabeeos) PRETTY_NAME="gabeeOS Linux";; - garuda) PRETTY_NAME="Garuda Linux";; - ghostbsd) PRETTY_NAME="GhostBSD";; - holoiso) PRETTY_NAME="SteamOS HoloISO";; - kdeneon) PRETTY_NAME="KDE Neon";; - kolibrios) PRETTY_NAME="KolibriOS";; - linuxlite) PRETTY_NAME="Linux Lite";; - linuxmint) PRETTY_NAME="Linux Mint";; - lmde) PRETTY_NAME="Linux Mint Debian Edition";; - mageia) PRETTY_NAME="Mageia";; - miyo) PRETTY_NAME="Miyo Linux";; - mxlinux) PRETTY_NAME="MX Linux";; - netboot) PRETTY_NAME="netboot.xyz";; - netbsd) PRETTY_NAME="NetBSD";; - nitrux) PRETTY_NAME="Nitrux";; - nixos) PRETTY_NAME="NixOS";; - macos) PRETTY_NAME="macOS";; - openbsd) PRETTY_NAME="OpenBSD";; - openindiana) PRETTY_NAME="OpenIndiana";; - opensuse) PRETTY_NAME="openSUSE";; - oraclelinux) PRETTY_NAME="Oracle Linux";; - peppermint) PRETTY_NAME="PeppermintOS";; - popos) PRETTY_NAME="Pop!_OS";; - primtux) PRETTY_NAME="Primtux";; - pureos) PRETTY_NAME="PureOS";; - reactos) PRETTY_NAME="ReactOS";; - rebornos) PRETTY_NAME="RebornOS";; - rockylinux) PRETTY_NAME="Rocky Linux";; - slitaz) PRETTY_NAME="SliTaz GNU/Linux";; - sparkylinux) PRETTY_NAME="SparkyLinux";; - spiral) PRETTY_NAME="SpiralLinux";; - tinycore) PRETTY_NAME="Tiny Core Linux";; - truenas-core) PRETTY_NAME="TrueNAS Core";; - truenas-scale) PRETTY_NAME="TrueNAS Scale";; - tuxedoos) PRETTY_NAME="TuxedoOS";; - ubuntu-budgie) PRETTY_NAME="Ubuntu Budgie";; - ubuntucinnamon) PRETTY_NAME="Ubuntu Cinnamon";; - ubuntukylin) PRETTY_NAME="Ubuntu Kylin";; - ubuntu-mate) PRETTY_NAME="Ubuntu MATE";; - ubuntu-server) PRETTY_NAME="Ubuntu Server";; - ubuntustudio) PRETTY_NAME="Ubuntu Studio";; - ubuntu-unity) PRETTY_NAME="Ubuntu Unity";; - vanillaos) PRETTY_NAME="Vanilla OS";; - ventoy) PRETTY_NAME="Ventoy";; - void) PRETTY_NAME="Void Linux";; - voidpup) PRETTY_NAME="Void Puppy";; - vxlinux) PRETTY_NAME="VX Linux";; - xerolinux) PRETTY_NAME="XeroLinux";; - zorin) PRETTY_NAME="Zorin OS";; - *) PRETTY_NAME="${SIMPLE_NAME^}";; - esac - echo "${PRETTY_NAME}" + local SIMPLE_NAME="" + local PRETTY_NAME="" + SIMPLE_NAME="${1}" + PRETTY_NAME=$(os_info ${SIMPLE_NAME} | cut -d'|' -f1) + echo "${PRETTY_NAME}" +} + +function os_basedof() { + local SIMPLE_NAME="" + local BASED="" + SIMPLE_NAME="${1}" + BASED=$(os_info ${SIMPLE_NAME} | cut -d'|' -f2) + echo "${BASED}" +} + +function os_credentials() { + local SIMPLE_NAME="" + local CREDE="" + SIMPLE_NAME="${1}" + CREDE=$(os_info ${SIMPLE_NAME} | cut -d'|' -f3) + echo "${CREDE}" +} + +function os_homepage(){ + local SIMPLE_NAME="" + local HOMEP="" + SIMPLE_NAME="${1}" + HOMEP=$(os_info ${SIMPLE_NAME} | cut -d'|' -f4) + echo "$HOMEP" +} + +function os_about() { + local SIMPLE_NAME="" + local ABOUT="" + SIMPLE_NAME="${1}" + ABOUT=$(os_info ${SIMPLE_NAME} | cut -d'|' -f5) + echo "${ABOUT}" } function validate_release() { - local DISPLAY_NAME="" - local RELEASE_GENERATOR="" - local RELEASES="" + local DISPLAY_NAME="" + local RELEASE_GENERATOR="" + local RELEASES="" - DISPLAY_NAME="$(pretty_name "${OS}")" - case ${OS} in - *ubuntu-server*) RELEASE_GENERATOR="releases_ubuntu-server";; - *ubuntu*) RELEASE_GENERATOR="releases_ubuntu";; - *) RELEASE_GENERATOR="${1}";; - esac + DISPLAY_NAME="$(pretty_name "${OS}")" + case ${OS} in + *ubuntu-server*) RELEASE_GENERATOR="releases_ubuntu-server";; + *ubuntu*) RELEASE_GENERATOR="releases_ubuntu";; + *) RELEASE_GENERATOR="${1}";; + esac - RELEASES=$(${RELEASE_GENERATOR}) - if [[ "${RELEASES}" != *"${RELEASE}"* ]]; then - echo -e "ERROR! ${DISPLAY_NAME} ${RELEASE} is not a supported release.\n" - echo -n "${RELEASES}" - exit 1 - fi + RELEASES=$(${RELEASE_GENERATOR}) + if [[ ! " ${RELEASES[*]} " =~ " ${RELEASE} " ]]; then + echo -e "ERROR! ${DISPLAY_NAME} ${RELEASE} is not a supported release." + echo " - Releases: ${RELEASES}" + exit 1 + fi } function list_json() { - # Reference: https://stackoverflow.com/a/67359273 - list_csv | jq -R 'split(",") as $h|reduce inputs as $in ([]; . += [$in|split(",")|. as $a|reduce range(0,length) as $i ({};.[$h[$i]]=$a[$i])])' - exit 0 + # Reference: https://stackoverflow.com/a/67359273 + list_csv | jq -R 'split(",") as $h|reduce inputs as $in ([]; . += [$in|split(",")|. as $a|reduce range(0,length) as $i ({};.[$h[$i]]=$a[$i])])' + exit 0 } function list_csv() { @@ -211,9 +232,7 @@ function list_csv() { SVG="https://quickemu-project.github.io/quickemu-icons/svg/${FUNC}/${FUNC}-quickemu-white-pinkbg.svg" for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases - if [ "${OS}" == "macos" ]; then - DOWNLOADER="macrecovery" - elif [[ "${OS}" == *"ubuntu"* ]] && [ "${RELEASE}" == "devel" ] && [ ${HAS_ZSYNC} -eq 1 ]; then + if [[ "${OS}" == *"ubuntu"* ]] && [ "${RELEASE}" == "devel" ] && [ ${HAS_ZSYNC} -eq 1 ]; then DOWNLOADER="zsync" else DOWNLOADER="${DL}" @@ -224,7 +243,8 @@ function list_csv() { for OPTION in $(editions_"${OS}"); do echo "${DISPLAY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}" done - elif [ "${OS}" == "windows" ]; then + elif [[ "${OS}" == "windows"* ]]; then + "languages_${OS}" for OPTION in "${LANGS[@]}"; do echo "${DISPLAY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}" done @@ -236,33 +256,178 @@ function list_csv() { exit 0 } +list_supported() { + # output OS RELEASE EDITION (usefull for straight testing...) + local DL="" + local FUNC + local OPTION + local OS + + for OS in $(os_support); do + case ${OS} in + *ubuntu-server*) FUNC="ubuntu-server";; + *ubuntu*) FUNC="ubuntu";; + *) FUNC="${OS}";; + esac + for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases + # If the OS has an editions_() function, use it. + if [[ $(type -t "editions_${OS}") == function ]]; then + for OPTION in $(editions_"${OS}"); do + echo "${OS} ${RELEASE} ${OPTION}" + done + elif [[ "${OS}" == "windows"* ]]; then + "languages_${OS}" + for OPTION in "${LANGS[@]}"; do + echo "${OS} ${RELEASE} ${OPTION}" + done + else + echo "${OS} ${RELEASE}" + fi + done + done + exit 0 +} + +list_isos() { + local URL + local FUNC + local OPTION + local OS + + echo "OS|Release|Edition|URL" + for OS in $(os_support); do + case ${OS} in + *ubuntu-server*) FUNC="ubuntu-server";; + *ubuntu*) FUNC="ubuntu";; + *) FUNC="${OS}";; + esac + for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases + # If the OS has an editions_() function, use it. + if [[ $(type -t "editions_${OS}") == function ]]; then + for OPTION in $(editions_"${OS}"); do + URL=$(./quickget -u ${OS} ${RELEASE} ${OPTION}) + if [ -z "${URL}" ]; then + echo "${OS}|${RELEASE}|${OPTION}|${URL}" + else + echo "${OS}|${RELEASE}|${OPTION}|${URL}" + fi + done + elif [[ "${OS}" == "windows"* ]]; then + "languages_${OS}" + for OPTION in "${LANGS[@]}"; do + #URL=$(./quickget -u ${OS} ${RELEASE} ${OPTION}) + if [ -n "${URL}" ]; then + echo "${OS}|${RELEASE}|${OPTION}|" + else + echo "${OS}|${RELEASE}|${OPTION}|Strange!" + fi + done + elif [[ "${OS}" == "macos" ]]; then + echo "${OS}|${RELEASE}|${OPTION}|" + else + URL=$(./quickget -u ${OS} ${RELEASE}) + if [ -z "${URL}" ]; then + echo "${OS}|${RELEASE}|${OPTION}|${URL}" + else + echo "${OS}|${RELEASE}|${OPTION}|${URL}" + fi + fi + done + done + exit 0 +} + +test_isos() { + local DL="" + local URL + local ISO + local FUNC + local OPTION + local OS + local RELEASE + local HAS_ZSYNC=0 + local GOOD + + # Check if zsync is available + if command -v zsync &>/dev/null; then + HAS_ZSYNC=1 + fi + if command -v aria2c &>/dev/null; then + DL="aria2c" + elif command -v wget &>/dev/null; then + DL="wget" + fi + echo "Status - OS|Release|Edition|URL" + for OS in $(os_support); do + case ${OS} in + *ubuntu-server*) FUNC="ubuntu-server";; + *ubuntu*) FUNC="ubuntu";; + *) FUNC="${OS}";; + esac + for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases + if [[ "${OS}" == *"ubuntu"* ]] && [ "${RELEASE}" == "devel" ] && [ ${HAS_ZSYNC} -eq 1 ]; then + DOWNLOADER="zsync" + else + DOWNLOADER="${DL}" + fi + # If the OS has an editions_() function, use it. + if [[ $(type -t "editions_${OS}") == function ]]; then + for OPTION in $(editions_"${OS}"); do + #URL=$(timeout 10 ./quickget -u ${OS} ${RELEASE} ${OPTION}) + URL=$(timeout 10 ./quickget -u ${OS} ${RELEASE} ${OPTION}) + GOOD=$(wget -q --spider ${URL} && echo 'OK' || echo 'ERROR!') + if [[ "${GOOD}" == "OK" ]]; then + echo "OK - ${OS}|${RELEASE}|${OPTION}|${URL}" + else + echo "ERROR - ${OS}|${RELEASE}|${OPTION}|${URL}" + fi + done + elif [[ "${OS}" == "windows"* ]]; then + "languages_${OS}" + for OPTION in "${LANGS[@]}"; do + #URL=$(timeout 10 ./quickget -u ${OS} ${RELEASE} ${OPTION}) + if [ -z "${URL}" ]; then + echo "N - ${OS}|${RELEASE}|${OPTION}|" + else + echo "N - ${OS}|${RELEASE}|${OPTION}|" + fi + done + else + URL=$(./quickget -u ${OS} ${RELEASE} ${OPTION}) + GOOD=$(timeout 10 wget -q --spider ${URL} && echo 'OK' || echo 'ERROR!') + if [[ "${GOOD}" == "OK" ]]; then + echo "OK - ${OS}|${RELEASE}|${OPTION}|${URL}" + else + echo "ERROR - ${OS}|${RELEASE}|${OPTION}|${URL}" + fi + fi + done + done + exit 0 +} + function os_support() { - echo agarimos \ - alma \ + echo alma \ alpine \ android \ antix \ archlinux \ archcraft \ arcolinux \ - antix \ - artixlinux \ + artix \ athenaos \ batocera \ bazzite \ - biglinux \ blendos \ bodhi \ bunsenlabs \ cachyos \ centos-stream \ - cereus \ chimeralinux \ crunchbang++ \ debian \ deepin \ devuan \ - dietpi \ dragonflybsd \ easyos \ edubuntu \ @@ -272,8 +437,6 @@ function os_support() { fedora \ freebsd \ freedos \ - fvoid \ - gabeeos \ garuda \ gentoo \ ghostbsd \ @@ -288,7 +451,6 @@ function os_support() { lmde \ mageia \ manjaro \ - miyo \ mxlinux \ netboot \ netbsd \ @@ -301,6 +463,7 @@ function os_support() { opensuse \ oraclelinux \ peppermint \ + parrotsec \ popos \ porteus \ primtux \ @@ -311,16 +474,16 @@ function os_support() { siduction \ slackware \ slax \ + slint \ slitaz \ solus \ sparkylinux \ - spiral \ + spirallinux \ tails \ tinycore \ trisquel \ truenas-core \ truenas-scale \ - tuxedoos \ ubuntu \ ubuntu-budgie \ ubuntucinnamon \ @@ -330,262 +493,22 @@ function os_support() { ubuntustudio \ ubuntu-unity \ vanillaos \ - ventoy \ void \ - voidpup \ vxlinux \ windows \ + windows-server \ xerolinux \ xubuntu \ zorin } -function os_homepage(){ - local SIMPLE_NAME="" - local HOMEPAGE="" - SIMPLE_NAME="${1}" - case ${SIMPLE_NAME} in - agarimos) HOMEPAGE="https://sourceforge.net/projects/agarimos/";; - alma) HOMEPAGE="https://almalinux.org/";; - alpine) HOMEPAGE="https://alpinelinux.org/";; - android) HOMEPAGE="https://www.android-x86.org/";; - antix) HOMEPAGE="https://antixlinux.com/";; - archlinux) HOMEPAGE="https://archlinux.org/";; - archcraft) HOMEPAGE="https://archcraft.io/";; - arcolinux) HOMEPAGE="https://arcolinux.com/";; - artixlinux) HOMEPAGE="https://artixlinux.com/";; - athenaos) HOMEPAGE="https://athenaos.org/";; - batocera) HOMEPAGE="https://batocera.org/";; - bazzite) HOMEPAGE="https://bazzite.gg/";; - biglinux) HOMEPAGE="https://www.biglinux.com.br/";; - blendos) HOMEPAGE="https://blendos.co/";; - bodhi) HOMEPAGE="https://www.bodhilinux.com/";; - bunsenlabs) HOMEPAGE="https://www.bunsenlabs.org/";; - cachyos) HOMEPAGE="https://cachyos.org/";; - centos-stream) HOMEPAGE="https://www.centos.org/centos-stream/";; - cereues) HOMEPAGE="https://cereus-linux.sourceforge.io/";; - chimeralinux) HOMEPAGE="https://chimera-linux.org/";; - crunchbang++) HOMEPAGE="https://www.crunchbangplusplus.org/";; - debian) HOMEPAGE="https://www.debian.org/";; - deepin) HOMEPAGE="https://www.deepin.org/";; - devuan) HOMEPAGE="https://www.devuan.org/";; - dietpi) HOMEPAGE="https://dietpi.com/";; - dragonflybsd) HOMEPAGE="https://www.dragonflybsd.org/";; - easyos) HOMEPAGE="https://easyos.org/";; - edubuntu) HOMEPAGE="https://www.edubuntu.org/";; - elementary) HOMEPAGE="https://elementary.io/";; - endeavouros) HOMEPAGE="https://endeavouros.com/";; - endless) HOMEPAGE="https://www.endlessos.org/os";; - fedora) HOMEPAGE="https://www.fedoraproject.org/";; - freebsd) HOMEPAGE="https://www.freebsd.org/";; - freedos) HOMEPAGE="https://freedos.org/";; - fvoid) HOMEPAGE="https://f-void.sourceforge.io/";; - gabeeos) HOMEPAGE="https://gabeeoslinux.sourceforge.io/";; - garuda) HOMEPAGE="https://garudalinux.org/";; - gentoo) HOMEPAGE="https://www.gentoo.org/";; - ghostbsd) HOMEPAGE="https://www.ghostbsd.org/";; - haiku) HOMEPAGE="https://www.haiku-os.org/";; - holoiso) HOMEPAGE="https://github.com/HoloISO/holoiso";; - kali) HOMEPAGE="https://www.kali.org/";; - kdeneon) HOMEPAGE="https://neon.kde.org/";; - kolibrios) HOMEPAGE="http://kolibrios.org/en/";; - kubuntu) HOMEPAGE="https://kubuntu.org/";; - linuxlite) HOMEPAGE="https://www.linuxliteos.com/";; - linuxmint) HOMEPAGE="https://linuxmint.com/";; - lmde) HOMEPAGE="https://www.linuxmint.com/download_lmde.php";; - lubuntu) HOMEPAGE="https://lubuntu.me/";; - mageia) HOMEPAGE="https://www.mageia.org/";; - manjaro) HOMEPAGE="https://manjaro.org/";; - mxlinux) HOMEPAGE="https://mxlinux.org/";; - miyo) HOMEPAGE="https://miyolinux.sourceforge.io/";; - netboot) HOMEPAGE="https://netboot.xyz/";; - netbsd) HOMEPAGE="https://www.netbsd.org/";; - nitrux) HOMEPAGE="https://nxos.org/";; - nixos) HOMEPAGE="https://nixos.org/";; - macos) HOMEPAGE="https://www.apple.com/macos/";; - openbsd) HOMEPAGE="https://www.openbsd.org/";; - openindiana) HOMEPAGE="https://www.openindiana.org/";; - opensuse) HOMEPAGE="https://www.opensuse.org/";; - oraclelinux) HOMEPAGE="https://www.oracle.com/linux/";; - peppermint) HOMEPAGE="https://peppermintos.com/";; - popos) HOMEPAGE="https://pop.system76.com/";; - porteus) HOMEPAGE="http://www.porteus.org/";; - primtux) HOMEPAGE="https://primtux.fr/";; - reactos) HOMEPAGE="https://reactos.org/";; - rebornos) HOMEPAGE="https://rebornos.org/";; - rockylinux) HOMEPAGE="https://rockylinux.org/";; - siduction) HOMEPAGE="https://siduction.org/";; - slackware) HOMEPAGE="http://www.slackware.com/";; - slax) HOMEPAGE="https://www.slax.org/";; - slitaz) HOMEPAGE="https://www.slitaz.org/";; - solus) HOMEPAGE="https://getsol.us/";; - sparkylinux) HOMEPAGE="https://sparkylinux.org/";; - spiral) HOMEPAGE="https://spirallinux.github.io/";; - tails) HOMEPAGE="https://tails.net/";; - tinycore) HOMEPAGE="http://www.tinycorelinux.net/";; - trisquel) HOMEPAGE="https://trisquel.info/";; - truenas-core) HOMEPAGE="https://www.truenas.com/truenas-core/";; - truenas-scale) HOMEPAGE="https://www.truenas.com/truenas-scale/";; - tuxedoos) HOMEPAGE="https://www.tuxedocomputers.com/en/TUXEDO-OS_1.tuxedo";; - ubuntu) HOMEPAGE="https://ubuntu.com/";; - ubuntu-budgie) HOMEPAGE="https://ubuntubudgie.org/";; - ubuntucinnamon) HOMEPAGE="https://ubuntucinnamon.org/";; - ubuntukylin) HOMEPAGE="https://ubuntukylin.com/";; - ubuntu-mate) HOMEPAGE="https://ubuntu-mate.org/";; - ubuntu-server) HOMEPAGE="https://ubuntu.com/server";; - ubuntustudio) HOMEPAGE="https://ubuntustudio.org/";; - ubuntu-unity) HOMEPAGE="https://ubuntuunity.org/";; - vanillaos) HOMEPAGE="https://vanillaos.org/";; - ventoy) HOMEPAGE="https://www.ventoy.net/";; - void) HOMEPAGE="https://voidlinux.org/";; - voidpup) HOMEPAGE="https://sourceforge.net/projects/vpup/";; - vxlinux) HOMEPAGE="https://vxlinux.org/";; - windows) HOMEPAGE="https://www.microsoft.com/en-us/windows/";; - xerolinux) HOMEPAGE="https://xerolinux.xyz/";; - xubuntu) HOMEPAGE="https://xubuntu.org/";; - zorin) HOMEPAGE="https://zorin.com/os/";; - esac - echo "${HOMEPAGE}" +# Get string before first whitespace (HASH) +function cut_1() { + cut -d' ' -f1 } -# Not in upstream -function releases_agarimos() { - echo latest -} - -function editions_agarimos() { - echo plasma xfce lxqt gnome -} - -function releases_artixlinux() { - echo stable -} - -function editions_artixlinux() { - echo base-dinit base-openrc base-runit base-s6 cinnamon-dinit cinnamon-openrc cinnamon-runit cinnamon-s6 lxde-dinit lxde-openrc lxde-runit lxde-s6 lxqt-dinit lxqt-openrc lxqt-runit lxqt-s6 mate-dinit mate-openrc mate-runit mate-s6 plasma-dinit plasma-openrc plasma-runit plasma-s6 xfce-dinit xfce-openrc xfce-runit xfce-s6 community-gtk-openrc community-qt-openrc -} - -function releases_athenaos() { - echo 23.06.23 -} - -function releases_batocera() { - echo latest -} - -function releases_bazzite() { - echo $(wget -q -O- "https://api.github.com/repos/ublue-os/bazzite/releases" | grep 'download_url' | grep 'sum' | cut -d '/' -f8 | cut -d'v' -f2 | tr '\n' ' ') -} - -function releases_biglinux() { - echo kde -} - -function releases_blendos() { -# Pull the rss feed -wget -q https://sourceforge.net/projects/blendos/rss?path=/ISOs/ -O- | grep -E -o 'https://.*blendOS\.iso.*/tmp/blendos-isos.rss - - local RLIST - RLIST=$(grep -E -o 'https://.*blendOS\.iso.*/tmp/blendos-isos.rss - - local RLIST - RLIST=$(grep -E -o 'https://.*blendOS\.iso.*/tmp/blendos-isos.rss + RLIST=$(grep -E -o 'https://.*blendOS\.iso.* -f9|cut -d\/ -f1) local DEBOLD=$(wget -q https://cdimage.debian.org/cdimage/archive/ -O- |grep -e '>[1-9][0-9]\.'|grep -v 'live' | cut -d\> -f9|cut -d\/ -f1 ) - echo ${DEBOLD} ${DEBCURRENT} + echo ${DEBCURRENT} # ${DEBOLD} } function editions_debian() { @@ -682,7 +663,7 @@ function editions_debian() { } function releases_deepin() { - echo 20 20.1 20.2 20.2.1 20.2.2 20.2.3 20.2.4 20.3 20.4 20.5 20.6 20.7 + echo 20.7 20.6 20.5 20.4 20.3 20.2.4 20.2.3 20.2.2 20.2.1 20.2 20.1 20 } function releases_devuan() { @@ -706,52 +687,51 @@ function releases_easyos() { } function releases_elementary() { - echo 7.0 7.1 + echo 7.1 7.0 } function releases_endeavouros() { - echo apollo_22_1 \ - artemis-22_6 \ - artemis_neo_22_7 \ - artemis_neo_22_8 \ - artemis_nova_22_9 \ - atlantis-21_4 \ - atlantis_neo-21_5 \ - cassini_22_12 + echo galileo-11-2023 \ + cassini_nova-03-2023_r3 \ + cassini_22_12 \ + cassini_neo_22_12 \ + artemis_nova_22_9 \ + artemis_neo_22_8 \ + artemis_neo_22_7 \ + artemis-22_6 \ + apollo_22_1 \ + atlantis_neo-21_5 \ + atlantis-21_4 } function releases_endless() { - echo 5.0.0 + echo 5.0.0 } function editions_endless() { - echo base en fr pt_BR es + echo base en fr pt_BR es } function releases_fedora() { - echo 38 39 -} - -function releases_batocera() { - echo latest + echo 39 38 } function editions_fedora() { - echo Workstation \ - Budgie \ - Cinnamon \ - i3 \ - KDE \ - LXDE \ - LXQt \ - Mate \ - Xfce \ - Silverblue \ - Sericea \ - Kinoite \ - Sway \ - Server \ - Onyx + echo Workstation \ + Budgie \ + Cinnamon \ + i3 \ + KDE \ + LXDE \ + LXQt \ + Mate \ + Xfce \ + Silverblue \ + Sericea \ + Kinoite \ + Sway \ + Server \ + Onyx } function releases_freebsd(){ @@ -764,7 +744,7 @@ function editions_freebsd(){ } function releases_freedos() { - echo 1.2 1.3 + echo 1.3 1.2 } function releases_garuda() { @@ -779,8 +759,12 @@ function releases_gentoo() { echo latest } +function editions_gentoo() { + echo minimal livegui +} + function releases_ghostbsd() { - echo 21.10.16 21.11.24 22.01.12 + echo 22.01.12 21.11.24 21.10.16 } function editions_ghostbsd() { @@ -788,7 +772,7 @@ function editions_ghostbsd() { } function releases_haiku() { - echo r1beta3 r1beta4 + echo r1beta4 r1beta3 } function editions_haiku() { @@ -812,11 +796,11 @@ function releases_kolibrios() { } function releases_linuxlite() { - echo 6.0 6.2 6.4 6.6 + echo 6.6 6.4 6.2 6.0 } function releases_linuxmint(){ - echo 20.2 20.3 21 21.1 21.2 + echo 21.2 21.1 21 20.3 20.2 } function editions_linuxmint(){ @@ -831,6 +815,10 @@ function releases_lmde(){ echo 5 } +function releases_macos() { + echo high-sierra mojave catalina big-sur monterey ventura sonoma +} + function releases_mageia(){ echo 8 } @@ -839,22 +827,10 @@ function editions_mageia(){ echo Plasma GNOME Xfce } -function releases_mxlinux(){ - echo 21.3 -} - -function editions_mxlinux(){ - echo Xfce KDE Fluxbox -} - function editions_manjaro(){ echo full minimal } -function releases_macos() { - echo high-sierra mojave catalina big-sur monterey ventura -} - function releases_manjaro() { echo xfce \ gnome \ @@ -866,8 +842,16 @@ function releases_manjaro() { sway } +function releases_mxlinux(){ + echo 21.3 +} + +function editions_mxlinux(){ + echo Xfce KDE Fluxbox +} + function releases_netboot() { - echo latest + echo latest } function releases_netbsd() { @@ -880,11 +864,11 @@ function releases_nitrux() { } function releases_nixos(){ - echo 21.05 21.11 22.05 22.11 23.05 23.11 + echo 23.11 23.05 22.11 22.05 21.11 21.05 } function editions_nixos(){ - echo gnome plasma5 minimal + echo minimal plasma5 gnome } function releases_openbsd(){ @@ -901,11 +885,19 @@ function editions_openindiana(){ } function releases_opensuse(){ - echo 15.0 15.1 15.2 15.3 15.4 microos tumbleweed + echo 15.4 15.3 15.2 15.1 15.0 microos tumbleweed } function releases_oraclelinux() { - echo 7.7 7.8 7.9 8.4 8.5 8.6 9.0 + echo 9.0 8.6 8.5 8.4 7.9 7.8 7.7 +} + +function releases_parrotsec() { + echo 6.0 5.3 4.11.3 +} + +function editions_parrotsec() { + echo architect home htb security } function releases_peppermint() { @@ -917,7 +909,7 @@ function editions_peppermint() { } function releases_popos() { - echo 20.04 21.10 22.04 + echo 22.04 21.10 20.04 } function editions_popos() { @@ -925,7 +917,7 @@ function editions_popos() { } function releases_porteus() { - echo 5.0 5.01 + echo 5.01 5.0 } function editions_porteus() { @@ -956,14 +948,8 @@ function releases_rebornos() { echo latest } -function get_rebornos() { - local ISO=$(wget -q -O- "https://meta.cdn.soulharsh007.dev/RebornOS-ISO?format=json" | jq -r ".url") - local HASH=$(wget -q -O- "https://meta.cdn.soulharsh007.dev/RebornOS-ISO?format=json" | jq -r ".md5") - echo "${ISO} ${HASH}" -} - function releases_rockylinux() { - echo 8.3 8.4 8.5 8.6 8.7 9.0 9.1 + echo 9.1 9.0 8.7 8.6 8.5 8.4 8.3 } function editions_rockylinux() { @@ -979,7 +965,23 @@ function editions_siduction() { } function releases_slackware() { - echo 14.2 15.0 + echo 15.0 14.2 +} + +function releases_slax() { + echo latest +} + +function editions_slax() { + echo debian slackware +} + +function releases_slint() { + echo 15.0 14.2.1 +} + +function releases_slitaz() { + echo preferred core core64 loram core-5in1 preinit } function releases_solus() { @@ -999,11 +1001,11 @@ function editions_sparkylinux() { echo lxqt mate xfce kde minimalgui minimalcli gameover multimedia rescue } -function releases_spiral() { +function releases_spirallinux() { echo latest } -function editions_spiral() { +function editions_spirallinux() { echo Plasma XFCE Mate LXQt Gnome Budgie Cinnamon Builder } @@ -1020,7 +1022,7 @@ function editions_tinycore() { } function releases_trisquel() { - echo 10.0.1 11.0 + echo 11.0 10.0.1 } function editions_trisquel() { @@ -1028,18 +1030,18 @@ function editions_trisquel() { } function releases_truenas() { - if [[ $OS == truenas ]] ; then - echo "ERROR! The supported TrueNAS OS values are truenas-core or truenas-scale" - exit 1; - fi - } + if [[ $OS == truenas ]] ; then + echo "ERROR! The supported TrueNAS OS values are truenas-core or truenas-scale" + exit 1; + fi +} function releases_truenas-core() { - echo 12.0 13.0 + echo 13.0 12.0 } function releases_truenas-scale() { - echo 22.02 22.12 + echo 22.12 22.02 } function releases_ubuntu() { @@ -1058,26 +1060,25 @@ function releases_ubuntu() { done case "${OS}" in - edubuntu|ubuntu-unity|ubuntucinnamon) + edubuntu|ubuntu-unity|ubuntucinnamon) echo ${INTERIM_SUPPORT[@]} daily-live ;; - kubuntu|lubuntu|ubuntukylin|ubuntu-mate|ubuntustudio|xubuntu) + kubuntu|lubuntu|ubuntukylin|ubuntu-mate|ubuntustudio|xubuntu) ## after 14.04 - echo ${LTS_SUPPORT[@]:1} ${INTERIM_SUPPORT[@]} daily-live jammy-daily ${EOL_VERSIONS[@]/#/eol-} + echo ${LTS_SUPPORT[@]:1} ${INTERIM_SUPPORT[@]} daily-live jammy-daily #${EOL_VERSIONS[@]/#/eol-} ;; - ubuntu-budgie) + ubuntu-budgie) #after 16.04 - echo ${LTS_SUPPORT[@]:2} ${INTERIM_SUPPORT[@]} daily-live jammy-daily ${EOL_VERSIONS[@]/#/eol-} + echo ${LTS_SUPPORT[@]:2} ${INTERIM_SUPPORT[@]} daily-live jammy-daily #${EOL_VERSIONS[@]/#/eol-} ;; - ubuntu) - echo ${LTS_SUPPORT[@]} ${INTERIM_SUPPORT[@]} daily-live ${EOL_VERSIONS[@]/#/eol-} + ubuntu) + echo ${LTS_SUPPORT[@]} ${INTERIM_SUPPORT[@]} daily-live #${EOL_VERSIONS[@]/#/eol-} ;; esac } function releases_ubuntu-server() { local ALL_VERSIONS=($(IFS=$'\n' wget -qO- http://releases.ubuntu.com/streams/v1/com.ubuntu.releases:ubuntu-server.json | jq -r '.products[] | select(.arch=="amd64") | .version')) - local LTS_SUPPORT=() local INTERIM_SUPPORT=() @@ -1092,7 +1093,6 @@ function releases_ubuntu-server() { break fi done - echo ${LTS_SUPPORT[@]} ${INTERIM_SUPPORT[@]} daily-live } @@ -1113,7 +1113,32 @@ function releases_vxlinux() { } function releases_windows() { - echo 8 10 11 + echo 11 10-ltsc 10 8 +} + +function languages_windows() { + if [ "${RELEASE}" == 8 ]; then + LANGS=("Arabic" "Brazilian Portuguese" "Bulgarian" "Chinese (Simplified)" "Chinese (Traditional)" "Chinese (Traditional Hong Kong)" \ + "Croatian" "Czech" "Danish" "Dutch" "English (United States)" "English International" "Estonian" "Finnish" "French" "German" "Greek" \ + "Hebrew" "Hungarian" "Italian" "Japanese" "Latvian" "Lithuanian" "Norwegian" "Polish" "Portuguese" "Romanian" "Russian" "Serbian Latin" \ + "Slovak" "Slovenian" "Spanish" "Swedish" "Thai" "Turkish" "Ukrainian") + elif [ "${RELEASE}" == "10-ltsc" ]; then + LANGS=("English (United States)" "English (Great Britain)" "Chinese (Simplified)" "Chinese (Traditional)" \ + "French" "German" "Italian" "Japanese" "Korean" "Portuguese (Brazil)" "Spanish") + else + LANGS=("Arabic" "Brazilian Portuguese" "Bulgarian" "Chinese (Simplified)" "Chinese (Traditional)" "Croatian" "Czech" "Danish" "Dutch" \ + "English (United States)" "English International" "Estonian" "Finnish" "French" "French Canadian" "German" "Greek" "Hebrew" "Hungarian" \ + "Italian" "Japanese" "Korean" "Latvian" "Lithuanian" "Norwegian" "Polish" "Portuguese" "Romanian" "Russian" "Serbian Latin" "Slovak" \ + "Slovenian" "Spanish" "Spanish (Mexico)" "Swedish" "Thai" "Turkish" "Ukrainian") + fi +} + +function releases_windows-server() { + echo 2022 2019 2016 2012-r2 +} + +function languages_windows-server() { + LANGS=("English (United States)" "Chinese (Simplified)" "French" "German" "Italian" "Japanese" "Russian" "Spanish") } function releases_xerolinux() { @@ -1121,7 +1146,7 @@ function releases_xerolinux() { } function releases_zorin() { - echo 16 + echo 17 16 } function editions_zorin() { @@ -1132,7 +1157,7 @@ function check_hash() { local iso="" local hash="" local hash_algo="" - if [ "${download_iso}" == "on" ]; then + if [ "${download_iso}" == 1 ]; then iso="${1}" else iso="${VM_PATH}/${1}" @@ -1145,8 +1170,8 @@ function check_hash() { 40) hash_algo=sha1sum;; 64) hash_algo=sha256sum;; 128) hash_algo=sha512sum;; - *) echo "WARNING! Can't guess hash algorithm, not checking ${iso} hash." - return;; + *) echo "WARNING! Can't guess hash algorithm, not checking ${iso} hash." + return;; esac echo -n "Checking ${iso} with ${hash_algo}... " @@ -1170,30 +1195,51 @@ function web_get() { FILE="${URL##*/}" fi + while (( "$#" )); do + if [[ $1 == --header ]]; then + HEADERS+=("$1" "$2") + shift 2 + else + shift + fi + done + # Test mode for ISO - if [ "${show_iso_url}" == 'on' ]; then + if [ "${show_iso_url}" == 1 ]; then echo "${URL}" exit 0 - elif [ "${test_iso_url}" == 'on' ]; then - wget --spider "${URL}" + elif [ "${test_iso_url}" == 1 ]; then + echo -n "Testing if $(echo ${URL} | rev | cut -d'/' -f1 | rev) is available... " + wget -q --spider "${URL}" && echo 'Sucessfull' || echo 'ERROR!' exit 0 - elif [ "${download_iso}" == 'on' ]; then + elif [ "${download_iso}" == 1 ]; then DIR="$(pwd)" fi if [ "${DIR}" != "$(pwd)" ] && ! mkdir -p "${DIR}" 2>/dev/null; then - echo "ERROR! Unable to create directory ${DIR}" - exit 1 + echo "ERROR! Unable to create directory ${DIR}" + exit 1 + fi + + if [[ ${OS} != windows && ${OS} != macos && ${OS} != windows-server ]]; then + echo Downloading $(pretty_name "${OS}") ${RELEASE} ${EDITION:+ $EDITION} from ${URL} fi if command -v aria2c &>/dev/null; then - if ! aria2c --stderr -x16 --continue=true --summary-interval=0 --download-result=hide --console-log-level=error "${URL}" --dir "${DIR}" -o "${FILE}"; then - echo #Necessary as aria2c in suppressed mode does not have new lines - echo "ERROR! Failed to download ${URL} with aria2c. Try running 'quickget' again." - exit 1 + if ! aria2c --stderr -x16 --continue=true --summary-interval=0 --download-result=hide --console-log-level=error "${URL}" --dir "${DIR}" -o "${FILE}" "${HEADERS[@]}"; then + echo #Necessary as aria2c in suppressed mode does not have new lines + echo "ERROR! Failed to download ${URL} with aria2c. Try running 'quickget' again." + exit 1 fi + echo #Necessary as aria2c in suppressed mode does not have new lines - elif ! wget --quiet --continue --tries=3 --read-timeout=10 --show-progress --progress=bar:force:noscroll "${URL}" -O "${DIR}/${FILE}"; then + elif command -v wget2 &>/dev/null; then + if ! wget2 --quiet --continue --tries=3 --read-timeout=10 --force-progress --progress=bar:force:noscroll "${URL}" -O "${DIR}/${FILE}" "${HEADERS[@]}"; then + echo "ERROR! Failed to download ${URL} with wget2. Try running 'quickget' again." + exit 1 + fi + + elif ! wget --quiet --continue --tries=3 --read-timeout=10 --show-progress --progress=bar:force:noscroll "${URL}" -O "${DIR}/${FILE}" "${HEADERS[@]}"; then echo "ERROR! Failed to download ${URL} with wget. Try running 'quickget' again." exit 1 fi @@ -1206,10 +1252,10 @@ function zsync_get() { local URL="${1}" # Test mode for ISO - if [ "${show_iso_url}" == 'on' ]; then + if [ "${show_iso_url}" == 1 ]; then echo "${URL}" exit 0 - elif [ "${test_iso_url}" == 'on' ]; then + elif [ "${test_iso_url}" == 1 ]; then wget --spider "${URL}" exit 0 elif command -v zsync &>/dev/null; then @@ -1220,10 +1266,11 @@ function zsync_get() { fi if ! mkdir -p "${DIR}" 2>/dev/null; then - echo "ERROR! Unable to create directory ${DIR}" - exit 1 + echo "ERROR! Unable to create directory ${DIR}" + exit 1 fi + echo -e Downloading $(pretty_name "${OS}") ${RELEASE} ${EDITION+ ${EDITION}} from ${URL}'\n' # Only force http for zsync - not earlier because we might fall through here if ! zsync "${URL/https/http}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then echo "ERROR! Failed to download ${URL/https/http}.zsync" @@ -1249,7 +1296,12 @@ function make_vm_config() { local ISO_FILE="" local IMAGE_TYPE="" local GUEST="" - local SEC_BOOT="" + #not needed anymore? + #local SEC_BOOT="" + + if [ "${download_iso}" == 1 ]; then + exit 0 + fi if [ "${download_iso}" == "on" ]; then exit 0 @@ -1258,55 +1310,54 @@ function make_vm_config() { IMAGE_FILE="${1}" ISO_FILE="${2}" case "${OS}" in - batocera) - GUEST="batocera" - IMAGE_TYPE="img";; - dragonflybsd) - GUEST="dragonflybsd" - IMAGE_TYPE="iso";; - freebsd|ghostbsd) - GUEST="freebsd" - IMAGE_TYPE="iso";; - haiku) - GUEST="haiku" - IMAGE_TYPE="iso";; - freedos) - GUEST="freedos" - IMAGE_TYPE="iso";; - kolibrios) - GUEST="kolibrios" - IMAGE_TYPE="iso";; - macos) - GUEST="macos" - IMAGE_TYPE="img";; - netbsd) - GUEST="netbsd" - IMAGE_TYPE="iso";; - openbsd) - GUEST="openbsd" - IMAGE_TYPE="iso";; - openindiana) - GUEST="solaris" - IMAGE_TYPE="iso";; - reactos) - GUEST="reactos" - IMAGE_TYPE="iso";; - truenas*) - GUEST="truenas" - IMAGE_TYPE="iso";; - windows) - GUEST="windows" - IMAGE_TYPE="iso";; - *) - GUEST="linux" - IMAGE_TYPE="iso";; + batocera) + GUEST="batocera" + IMAGE_TYPE="img";; + dragonflybsd) + GUEST="dragonflybsd" + IMAGE_TYPE="iso";; + freebsd|ghostbsd) + GUEST="freebsd" + IMAGE_TYPE="iso";; + haiku) + GUEST="haiku" + IMAGE_TYPE="iso";; + freedos) + GUEST="freedos" + IMAGE_TYPE="iso";; + kolibrios) + GUEST="kolibrios" + IMAGE_TYPE="iso";; + macos) + GUEST="macos" + IMAGE_TYPE="img";; + netbsd) + GUEST="netbsd" + IMAGE_TYPE="iso";; + openbsd) + GUEST="openbsd" + IMAGE_TYPE="iso";; + openindiana) + GUEST="solaris" + IMAGE_TYPE="iso";; + reactos) + GUEST="reactos" + IMAGE_TYPE="iso";; + truenas*) + GUEST="truenas" + IMAGE_TYPE="iso";; + windows) + GUEST="windows" + IMAGE_TYPE="iso";; + windows-server) + GUEST="windows-server" + IMAGE_TYPE="iso";; + *) + GUEST="linux" + IMAGE_TYPE="iso";; esac - if [ -n "${EDITION}" ]; then - CONF_FILE="${OS}-${RELEASE}-${EDITION}.conf" - else - CONF_FILE="${OS}-${RELEASE}.conf" - fi + CONF_FILE="${VM_PATH}.conf" if [ ! -e "${CONF_FILE}" ]; then echo "Making ${CONF_FILE}" @@ -1316,7 +1367,7 @@ guest_os="${GUEST}" disk_img="${VM_PATH}/disk.qcow2" ${IMAGE_TYPE}="${VM_PATH}/${IMAGE_FILE}" EOF - echo "Giving user execute permissions on ${CONF_FILE}," + echo "Giving user execute permissions on ${CONF_FILE}" chmod u+x "${CONF_FILE}" if [ -n "${ISO_FILE}" ]; then echo "fixed_iso=\"${VM_PATH}/${ISO_FILE}\"" >> "${CONF_FILE}" @@ -1324,14 +1375,14 @@ EOF # OS specific tweaks case ${OS} in - alma|centos-stream|endless|garuda|nixos|oraclelinux|popos|rockylinux) + alma|athenaos|centos-stream|endless|garuda|nixos|oraclelinux|popos|rockylinux) echo "disk_size=\"32G\"" >> "${CONF_FILE}";; openindiana) echo "boot=\"legacy\"" >> "${CONF_FILE}" echo "disk_size=\"32G\"" >> "${CONF_FILE}";; batocera) echo "disk_size=\"8G\"" >> "${CONF_FILE}";; - dragonflybsd|haiku|openbsd|netbsd|slackware|tails|tinycore) + dragonflybsd|haiku|openbsd|netbsd|slackware|slax|tails|tinycore) echo "boot=\"legacy\"" >> "${CONF_FILE}";; deepin) echo "disk_size=\"64G\"" >> "${CONF_FILE}" @@ -1347,6 +1398,9 @@ EOF echo "disk_size=\"2G\"" >> "${CONF_FILE}" echo "ram=\"128M\"" >> "${CONF_FILE}" ;; + slint) + echo "disk_size=\"50G\"" >> "${CONF_FILE}" + ;; slitaz) echo "boot=\"legacy\"" >> "${CONF_FILE}" echo "disk_size=\"4G\"" >> "${CONF_FILE}" @@ -1354,10 +1408,10 @@ EOF ;; truenas-scale|truenas-core) echo "boot=\"legacy\"" >> "${CONF_FILE}" - # the rest is non-functional - # echo "bootdrive_size=\"5G\"" >> "${CONF_FILE}" # boot drive - # echo "1stdrive_size=\"20G\"" >> "${CONF_FILE}" # for testing - # echo "2nddrive_size=\"20G\"" >> "${CONF_FILE}" # again, for testing + # the rest is non-functional + # echo "bootdrive_size=\"5G\"" >> "${CONF_FILE}" # boot drive + # echo "1stdrive_size=\"20G\"" >> "${CONF_FILE}" # for testing + # echo "2nddrive_size=\"20G\"" >> "${CONF_FILE}" # again, for testing ;; ubuntu-server) # 22.04+ fails on LVM build if disk size is < 10G @@ -1365,15 +1419,15 @@ EOF echo "disk_size=\"10G\"" >> "${CONF_FILE}" echo "ram=\"4G\"" >> "${CONF_FILE}" if [[ "${RELEASE}" == *"22.04"* ]]; then - echo "tpm=\"on\"" >> "${CONF_FILE}" + echo "tpm=\"on\"" >> "${CONF_FILE}" fi ;; vanillaos) - ## Minimum is 50G for abroot, but a 64GB is allocated to give some headroom - echo "disk_size=\"64G\"" >> "${CONF_FILE}" - ;; + ## Minimum is 50G for abroot, but a 64GB is allocated to give some headroom + echo "disk_size=\"64G\"" >> "${CONF_FILE}" + ;; zorin) - case ${EDITION} in + case ${EDITION} in education64|edulite64) echo "disk_size=\"32G\"" >> "${CONF_FILE}";; esac @@ -1393,18 +1447,24 @@ EOF esac if [ "${OS}" == "ubuntu" ] && [[ ${RELEASE} == *"daily"* ]]; then - # Minimum to install lobster testing is 18GB but 32GB are allocated for headroom - echo "disk_size=\"32G\"" >> "${CONF_FILE}" + # Minimum to install lobster testing is 18GB but 32GB are allocated for headroom + echo "disk_size=\"32G\"" >> "${CONF_FILE}" fi + # Enable TPM for Windows 11 - if [ "${OS}" == "windows" ] && [ "${RELEASE}" -ge 11 ]; then + if [ "${OS}" == "windows" ] && [ "${RELEASE}" == 11 ] || [ "${OS}" == "windows-server" ] && [ "${RELEASE}" == "2022" ]; then echo "tpm=\"on\"" >> "${CONF_FILE}" echo "secureboot=\"off\"" >> "${CONF_FILE}" fi fi + echo echo "To start your $(pretty_name "${OS}") virtual machine run:" - echo " quickemu --vm ${CONF_FILE}" + if [ ${OS} == "slint" ]; then + echo -e " quickemu --vm ${CONF_FILE}\nTo start Slint with braille support run:\n quickemu --vm --braille --display sdl ${CONF_FILE}" + else + echo " quickemu --vm ${CONF_FILE}" + fi echo exit 0 } @@ -1860,11 +1920,12 @@ function get_antix() { local EDITION="${1:-}" local HASH="" local ISO="" + local URL_runit="" local URL="https://sourceforge.net/projects/antix-linux/files/Final/antiX-${RELEASE}" case ${RELEASE} in - 21) URL_runit="${URL}/runit-bullseye";; - *) URL_runit="${URL}/runit-antiX-${RELEASE}";; + 21) URL_runit="${URL}/runit-bullseye";; + *) URL_runit="${URL}/runit-antiX-${RELEASE}";; esac case ${EDITION} in @@ -1886,48 +1947,90 @@ function get_antix() { ;; esac - HASH=$(wget -q -O- ${URL}/README.txt | grep "${ISO}" | cut -d' ' -f1 | head -1) - echo "${URL}/${ISO} ${HASH}" -} - -function get_archlinux() { - local HASH="" - local ISO="" - local URL="https://mirror.rackspace.com/archlinux" - ISO=$(wget -q -O- "https://archlinux.org/releng/releases/json/" | jq -r '.releases[0].iso_url') - HASH=$(wget -q -O- "https://archlinux.org/releng/releases/json/" | jq -r '.releases[0].sha1_sum') + HASH=$(wget -q -O- ${URL}/README.txt | grep "${ISO}" | cut_1 | head -1) echo "${URL}/${ISO} ${HASH}" } function get_archcraft() { local HASH="" local URL="" - local TMPURL="" + # no longer needed? + #local TMPURL="" - TMPURL=$(wget -q -S -O- --max-redirect=0 "https://sourceforge.net/projects/archcraft/files/latest/download" 2>&1 | grep -i Location | cut -d' ' -f4) - URL=${TMPURL%\?*} + # Check where the URL redirects using curl. Output to a nonexistent directory so it's not possible to successfully download the image + URL=$(curl -Lfs "https://sourceforge.net/projects/archcraft/files/latest/download" -w %{url_effective} -o /this/is/a/nonexistent/directory/$RANDOM/$RANDOM) echo "${URL} ${HASH}" } +function get_archlinux() { + local HASH="" + local ISO="archlinux-x86_64.iso" + local URL="https://mirror.rackspace.com/archlinux/iso/latest" + + HASH=$(wget -q -O- "${URL}/sha256sums.txt" | grep "${ISO}" | cut_1) + echo "${URL}/${ISO} ${HASH}" +} + function get_arcolinux() { local EDITION="${1:-}" local HASH="" local ISO="arcolinux${EDITION:0:1}-${RELEASE}-x86_64.iso" local URL="https://ant.seedhost.eu/arcolinux/iso/${RELEASE}" - HASH=$(wget -q -O- "${URL}/${ISO}.sha1" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha1" | cut_1) echo "${URL}/${ISO} ${HASH}" } -function get_bunsenlabs() { +function get_artix() { + local EDITION="${1:-}" local HASH="" - local ISO="beryllium-1-amd64.hybrid.iso" - local URL="https://ddl.bunsenlabs.org/ddl" - HASH=$(wget -q -O- "${URL}/release.sha256.txt" | head -1 | cut -d' ' -f1) + local ISO="" + local URL="https://iso.artixlinux.org/iso" + + DATE=$(wget -q -O- ${URL}/sha256sums | cut -d'-' -f4 | head -1) + ISO="artix-${EDITION}-${DATE}-x86_64.iso" + HASH=$(wget -q -O- ${URL}/sha256sums | grep "${ISO}") + echo "${URL}/${ISO} ${HASH}" +} + +function get_athenaos() { + local HASH="" + local URL="" + local ISO="" + + case ${RELEASE} in + rolling) + ISO="athena-rolling-x86_64.iso" + URL="https://sourceforge.net/projects/athena-iso/files/rolling" + HASH=$(wget -q -O- "${URL}/${ISO}.md5" | cut_1) + ;; + *) + ISO="athena-20${RELEASE}-x86_64.iso" + URL="https://sourceforge.net/projects/athena-iso/files/v${RELEASE}" + HASH=$(wget -q -O- 'https://sourceforge.net/projects/athena-iso/rss?path=/' | grep '.iso/download"' | grep "${RELEASE}" | cut -d '=' -f7 | cut -d'>' -f2 | cut -d'<' -f1) + ;; + esac + echo "${URL}/${ISO} ${HASH}" +} + +function get_batocera() { + local HASH="" + local URL="https://mirrors.o2switch.fr/batocera/x86_64/stable/last" + local ISO="$(curl -sl ${URL}/ | grep -e 'batocera.*img.gz'|cut -d\" -f2)" + + echo "${URL}/${ISO} ${HASH}" +} + +function get_bazzite() { + local HASH="" + local ISO="" + local URL="https://github.com/ublue-os/bazzite/releases/download/v${RELEASE}" + + ISO=$(wget -q -O- "https://api.github.com/repos/ublue-os/bazzite/releases" | grep 'download_url' | grep 'sum' | cut -d '"' -f4 | cut -d'.' -f1-5 | grep "${RELEASE}" | cut -d'/' -f9) + HASH=$(wget -q -O- "${URL}/${ISO}.sha256sum" | grep 'SHA256' | cut -d' ' -f4) echo "${URL}/${ISO} ${HASH}" } function get_blendos() { - local HASH="" local URL="" @@ -1939,32 +2042,14 @@ function get_blendos() { URL=$(grep ${RELEASE} /tmp/blendos-isos.rss | grep -E -o 'https://.*blendOS\.iso') HASH=$(grep ${RELEASE} /tmp/blendos-isos.rss | grep -E -o '[[:alnum:]]{32}') # ## fix up variables for path naming - EDITION=${RELEASE%%/*} - RELEASE=${RELEASE##*/} - # For UX maybe show the date of the release - #echo ${RELEASE##*/} "(" $(date -d @${RELEASE##*/}) ")" - # maybe $(date -d @${RELEASE##*/} '+%Y%m%d') - echo "${URL} ${HASH}" -} - -function get_vanillaos() { - # maybe use github api and dynamism for R2.0 but for 22.10 just - # hit their CDN - # - # https://cdn.vanillaos.org/assets/ISO/22.10-r8/VanillaOS-22.10-all.20230226.md5.txt - # https://cdn.vanillaos.org/assets/ISO/22.10-r8/VanillaOS-22.10-all.20230226.sha256.txt - local HASH=$(curl -s "https://cdn.vanillaos.org/assets/ISO/22.10-r8/VanillaOS-22.10-all.20230226.sha256.txt" | cut -d' ' -f1) - local URL="https://cdn.vanillaos.org/assets/ISO/22.10-r8/VanillaOS-22.10-all.20230226.iso" + EDITION=${RELEASE%%/*} + RELEASE=${RELEASE##*/} + # For UX maybe show the date of the release + #echo ${RELEASE##*/} "(" $(date -d @${RELEASE##*/}) ")" + # maybe $(date -d @${RELEASE##*/} '+%Y%m%d') echo "${URL} ${HASH}" } -function get_batocera() { - local HASH="" - local URL="https://mirrors.o2switch.fr/batocera/x86_64/stable/last" - local ISO="$(curl -sl ${URL}/ | grep -e 'batocera.*img.gz'|cut -d\" -f2)" - echo "${URL}/${ISO} ${HASH}" -} - function get_bodhi() { local EDITION="${1:-}" local HASH="" @@ -1975,7 +2060,16 @@ function get_bodhi() { standard) ISO="bodhi-${RELEASE}-64.iso";; *) ISO="bodhi-${RELEASE}-64-${EDITION}.iso";; esac - HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut_1) + echo "${URL}/${ISO} ${HASH}" +} + +function get_bunsenlabs() { + local HASH="" + local ISO="beryllium-1-amd64.hybrid.iso" + local URL="https://ddl.bunsenlabs.org/ddl" + + HASH=$(wget -q -O- "${URL}/release.sha256.txt" | head -1 | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -1983,13 +2077,14 @@ function get_cachyos() { local HASH="" local ISO="cachyos-${EDITION}-linux-${RELEASE}.iso" local URL="https://mirror.cachyos.org/ISO/${EDITION}/${RELEASE}" - HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut_1) echo "${URL}/${ISO} ${HASH}" } function get_centos-stream() { local HASH="" local ISO="" + case ${RELEASE} in 8) ISO="CentOS-Stream-${RELEASE}-x86_64-latest-${EDITION}.iso" @@ -2002,7 +2097,53 @@ function get_centos-stream() { HASH=$(wget -q -O- ${URL}/${ISO}.SHA256SUM | grep "SHA256 (${ISO}" | cut -d' ' -f4) ;; esac + echo "${URL}/${ISO} ${HASH}" +} +function get_chimeralinux() { + local EDITION="${1:-}" + local HASH="" + local DATE="" + local ISO="" + local URL="https://repo.chimera-linux.org/live/${RELEASE}" + + DATE=$(wget -q -O- "${URL}/sha256sums.txt" | head -n1 | cut -d'-' -f5) + ISO="chimera-linux-x86_64-LIVE-${DATE}-${EDITION}.iso" + HASH=$(wget -q -O- "${URL}/sha256sums.txt" | grep 'x86_64-LIVE' | grep "${EDITION}" | cut_1) + echo "${URL}/${ISO} ${HASH}" +} + +function get_crunchbang++() { + local HASH="" + local ISO="" + local URL="" + local URLPART="" + local URLPART2="" + + URLPART="https://github.com/CBPP/cbpp" + case ${RELEASE} in + 8) + URLPART2="releases/download/v1.0-amd64" + ISO="cbpp-1.0-amd64-20150428.iso" + ;; + 9) + URLPART2="9-amd64/releases/download/v9.0" + ISO="cbpp-9.0-amd64-20170621.iso" + ;; + 10) + URLPART2="releases/download/v10" + ISO="cbpp-10.1-amd64-20190713.iso" + ;; + 11) + URLPART2="releases/download/v11.2" + ISO="cbpp-11.2-amd64-20230514.iso" + ;; + 12) + URLPART2="releases/download/v12.0" + ISO="cbpp-12.0-amd64-20230611.iso" + ;; + esac + URL="${URLPART}/${URLPART2}" echo "${URL}/${ISO} ${HASH}" } @@ -2013,9 +2154,9 @@ function get_debian() { local URL="" DEBCURRENT=$(wget -q https://cdimage.debian.org/debian-cd/ -O- |grep '\.[0-9]/'|cut -d\> -f9|cut -d\/ -f1) - case ${RELEASE} in + case ${RELEASE} in "${DEBCURRENT}") URL="https://cdimage.debian.org/debian-cd/${RELEASE}-live/amd64/iso-hybrid";; - *) URL="https://cdimage.debian.org/cdimage/archive/${RELEASE}-live/amd64/iso-hybrid/";; + *) URL="https://cdimage.debian.org/cdimage/archive/${RELEASE}-live/amd64/iso-hybrid";; esac if [ "${EDITION}" == "netinst" ]; then @@ -2024,7 +2165,7 @@ function get_debian() { ISO="${ISO/-live/}" fi - HASH=$(wget -q -O- "${URL}/SHA512SUMS" | grep "${ISO}" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/SHA512SUMS" | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2037,15 +2178,14 @@ function get_deepin() { # fix iso name if [[ "${RELEASE}" == *"20" ]] ; then - EDITION="1003" - ISO="deepin-desktop-community-${EDITION}-amd64.iso" + EDITION="1003" + ISO="deepin-desktop-community-${EDITION}-amd64.iso" elif [[ "${RELEASE}" == *"20.1" ]]; then - EDITION="1010" - ISO="deepin-desktop-community-${EDITION}-amd64.iso" + EDITION="1010" + ISO="deepin-desktop-community-${EDITION}-amd64.iso" fi - HASH=$(wget -q -O- "${URL}/SHA256SUMS" | grep "${ISO}" | cut -d' ' -f1) - + HASH=$(wget -q -O- "${URL}/SHA256SUMS" | grep "${ISO}" | cut_1) #echo "${URL}/${ISO} ${HASH}" web_get "${URL}/${ISO}" "${VM_PATH}" check_hash "${ISO}" "${HASH}" @@ -2062,7 +2202,7 @@ function get_devuan() { chimaera) ISO="devuan_${RELEASE}_4.0.2_amd64_desktop-live.iso";; daedalus) ISO="devuan_${RELEASE}_5.0.0_amd64_desktop-live.iso";; esac - HASH=$(wget -q -O- "${URL}/SHASUMS.txt" | grep "${ISO}" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/SHASUMS.txt" | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2114,6 +2254,7 @@ function get_endless() { #https://d1anzknqnc1kmb.cloudfront.net/eos-image-keyring.gpg # (4096R: CB50 0F7B C923 3FAD 32B4 E720 9E0C 1250 587A 279C) local FILE_TS="" + # https://support.endlessos.org/en/installation/direct-download gives the info but computes the URLS in js # so parsing out the useful info is not happening tonight # Endless edition names are "base" for the small minimal one or the Language for the large full release @@ -2129,12 +2270,10 @@ function get_endless() { FILE_TS="230127-212646";; pt_BR) FILE_TS="230127-220328";; - esac - - URL="https://images-dl.endlessm.com/release/${RELEASE}/eos-amd64-amd64/${EDITION}" - ISO="eos-eos${RELEASE:0:3}-amd64-amd64.${FILE_TS}.${EDITION}.iso" - - echo "${URL}/${ISO}" + esac + URL="https://images-dl.endlessm.com/release/${RELEASE}/eos-amd64-amd64/${EDITION}" + ISO="eos-eos${RELEASE:0:3}-amd64-amd64.${FILE_TS}.${EDITION}.iso" + echo "${URL}/${ISO}" } function get_fedora() { @@ -2149,7 +2288,6 @@ function get_fedora() { Server|Kinoite|Onyx|Silverblue|Sericea|Workstation) VARIANT="${EDITION}";; *) VARIANT="Spins";; esac - JSON=$(wget -q -O- "https://getfedora.org/releases.json" | jq '.[] | select(.variant=="'${VARIANT}'" and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'")') URL=$(echo "${JSON}" | jq -r '.link' | head -n1) HASH=$(echo "${JSON}" | jq -r '.sha256' | head -n1) @@ -2172,16 +2310,15 @@ function get_freedos() { local URL="http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/${RELEASE}/official" case ${RELEASE} in - 1.2) - ISO="FD12CD.iso" - HASH=$(wget -q -O- "${URL}/FD12.sha" | grep "${ISO}" | cut -d' ' -f1) - ;; - 1.3) - ISO="FD13-LiveCD.zip" - HASH=$(wget -q -O- "${URL}/verify.txt" | grep -A 8 "sha256sum" | grep "${ISO}" | cut -d' ' -f1) - ;; + 1.2) + ISO="FD12CD.iso" + HASH=$(wget -q -O- "${URL}/FD12.sha" | grep "${ISO}" | cut_1) + ;; + 1.3) + ISO="FD13-LiveCD.zip" + HASH=$(wget -q -O- "${URL}/verify.txt" | grep -A 8 "sha256sum" | grep "${ISO}" | cut_1) + ;; esac - echo "${URL}/${ISO} ${HASH}" } @@ -2192,8 +2329,7 @@ function get_garuda() { local URL="https://iso.builds.garudalinux.org/iso/latest/garuda" ISO=${EDITION}/latest.iso - - HASH="$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1)" + HASH="$(wget -q -O- "${URL}/${ISO}.sha256" | cut_1)" echo "${URL}/${ISO} ${HASH}" } @@ -2202,8 +2338,12 @@ function get_gentoo() { local ISO="" local URL="https://mirror.bytemark.co.uk/gentoo/releases/amd64/autobuilds/" - ISO=$(wget -q -O- "${URL}/${RELEASE}-iso.txt" | grep install | cut -d' ' -f1) - HASH=$( wget -q -O- "${URL}/${ISO}.DIGESTS" | grep -A 1 SHA512 | grep iso | grep -v CONTENTS | cut -d' ' -f1) + case ${EDITION} in + minimal) ISO=$(wget -q -O- "${URL}/${RELEASE}-iso.txt" | grep install | cut -d' ' -f1) + HASH=$( wget -q -O- "${URL}/${ISO}.DIGESTS" | grep -A 1 SHA512 | grep iso | grep -v CONTENTS | cut -d' ' -f1);; + livegui) ISO=$(wget -q -O- "${URL}/${RELEASE}-iso.txt" | grep livegui | cut -d' ' -f1) + HASH=$( wget -q -O- "${URL}/${ISO}.DIGESTS" | grep -A 1 SHA512 | grep iso | grep -v CONTENTS | cut -d' ' -f1);; + esac echo "${URL}/${ISO} ${HASH}" } @@ -2238,7 +2378,7 @@ function get_holoiso() { local ISO=$(wget -q -O- "https://api.github.com/repos/HoloISO/holoiso/releases" | sed 's/ /\n/g' | grep "HoloISO_${RELEASES}" | cut -d'\' -f1 | cut -d'/' -f4) local URL="https://cd2.holoiso.ru.eu.org" # Can't find hash - #HASH=$(wget -q -O- "${URL}/${ISO}.sha256sum" | cut -d' ' -f1) + #HASH=$(wget -q -O- "${URL}/${ISO}.sha256sum" | cut_1) echo "${URL}/${ISO} #${HASH}" } @@ -2248,7 +2388,7 @@ function get_kali() { local URL="https://cdimage.kali.org/${RELEASE}" ISO=$(wget -q -O- "${URL}/?C=M;O=D" | grep -o ">kali-linux-.*-installer-amd64.iso" | head -n 1 | cut -c 2-) - HASH=$(wget -q -O- "${URL}/SHA256SUMS" | grep -v torrent | grep "${ISO}" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/SHA256SUMS" | grep -v torrent | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2258,7 +2398,7 @@ function get_kdeneon() { local URL="https://files.kde.org/neon/images/${RELEASE}/current" ISO=$(wget -q -O- "${URL}/neon-${RELEASE}-current.sha256sum" | cut -d' ' -f3-) - HASH=$(wget -q -O- "${URL}/neon-${RELEASE}-current.sha256sum" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/neon-${RELEASE}-current.sha256sum" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2274,7 +2414,7 @@ function get_linuxlite() { local ISO="linux-lite-${RELEASE}-64bit.iso" local URL="https://sourceforge.net/projects/linux-lite/files/${RELEASE}" - HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2284,7 +2424,7 @@ function get_linuxmint() { local ISO="linuxmint-${RELEASE}-${EDITION}-64bit.iso" local URL="https://mirror.bytemark.co.uk/linuxmint/stable/${RELEASE}" - HASH=$(wget -q -O- "${URL}/sha256sum.txt" | grep "${ISO}" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/sha256sum.txt" | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2294,87 +2434,134 @@ function get_lmde() { local ISO="lmde-${RELEASE}-${EDITION}-64bit.iso" local URL="https://mirror.bytemark.co.uk/linuxmint/debian" - HASH=$(wget -q -O- "${URL}/sha256sum.txt" | grep "${ISO}" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/sha256sum.txt" | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } +function generate_id() { + local macRecoveryID="" + local TYPE="${1}" + local valid_chars=("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F") + + for ((i=0; i<$TYPE; i++)); do + macRecoveryID+="${valid_chars[$((RANDOM % 16))]}" + done + echo "${macRecoveryID}" +} + function get_macos() { local BOARD_ID="" local CWD="" - local MACRECOVERY="" + local CHUNKCHECK="" local MLB="00000000000000000" local OS_TYPE="default" case ${RELEASE} in - lion) #10.7 - BOARD_ID="Mac-2E6FAB96566FE58C" - MLB="00000000000F25Y00";; - mountainlion) #10.8 - BOARD_ID="Mac-7DF2A3B5E5D671ED" - MLB="00000000000F65100";; - mavericks) #10.9 - BOARD_ID="Mac-F60DEB81FF30ACF6" - MLB="00000000000FNN100";; - yosemite) #10.10 - BOARD_ID="Mac-E43C1C25D4880AD6" - MLB="00000000000GDVW00";; - elcapitan) #10.11 - BOARD_ID="Mac-FFE5EF870D7BA81A" - MLB="00000000000GQRX00";; - sierra) #10.12 - BOARD_ID="Mac-77F17D7DA9285301" - MLB="00000000000J0DX00";; - high-sierra) #10.13 - BOARD_ID="Mac-BE088AF8C5EB4FA2" - MLB="00000000000J80300";; - mojave) #10.14 - BOARD_ID="Mac-7BA5B2DFE22DDD8C" - MLB="00000000000KXPG00";; - catalina) #10.15 - BOARD_ID="Mac-00BE6ED71E35EB86";; - big-sur) #11 - BOARD_ID="Mac-42FD25EABCABB274";; - monterey) #12 - BOARD_ID="Mac-E43C1C25D4880AD6";; - ventura) #13 - BOARD_ID="Mac-BE088AF8C5EB4FA2";; - *) echo "ERROR! Unknown release: ${RELEASE}" - releases_macos - exit 1;; + lion) #10.7 + BOARD_ID="Mac-2E6FAB96566FE58C" + MLB="00000000000F25Y00";; + mountainlion) #10.8 + BOARD_ID="Mac-7DF2A3B5E5D671ED" + MLB="00000000000F65100";; + mavericks) #10.9 + BOARD_ID="Mac-F60DEB81FF30ACF6" + MLB="00000000000FNN100";; + yosemite) #10.10 + BOARD_ID="Mac-E43C1C25D4880AD6" + MLB="00000000000GDVW00";; + elcapitan) #10.11 + BOARD_ID="Mac-FFE5EF870D7BA81A" + MLB="00000000000GQRX00";; + sierra) #10.12 + BOARD_ID="Mac-77F17D7DA9285301" + MLB="00000000000J0DX00";; + high-sierra) #10.13 + BOARD_ID="Mac-BE088AF8C5EB4FA2" + MLB="00000000000J80300";; + mojave) #10.14 + BOARD_ID="Mac-7BA5B2DFE22DDD8C" + MLB="00000000000KXPG00";; + catalina) #10.15 + BOARD_ID="Mac-00BE6ED71E35EB86";; + big-sur) #11 + BOARD_ID="Mac-42FD25EABCABB274";; + monterey) #12 + BOARD_ID="Mac-E43C1C25D4880AD6";; + ventura) #13 + BOARD_ID="Mac-BE088AF8C5EB4FA2";; + sonoma) + BOARD_ID="Mac-53FDB3D8DB8CA971";; + *) echo "ERROR! Unknown release: ${RELEASE}" + releases_macos + exit 1;; esac - # Use a bundled macrecovery if possible CWD="$(dirname "${0}")" - if [ -x "${CWD}/macrecovery" ]; then - MACRECOVERY="${CWD}/macrecovery" - elif [ -x /usr/bin/macrecovery ]; then - MACRECOVERY="/usr/bin/macrecovery" + if [ -x "${CWD}/chunkcheck" ]; then + CHUNKCHECK="${CWD}/chunkcheck" + elif [ -x /usr/bin/chunkcheck ]; then + CHUNKCHECK="/usr/bin/chunkcheck" else - web_get "https://raw.githubusercontent.com/wimpysworld/quickemu/master/macrecovery" "${HOME}/.quickemu" - MACRECOVERY="python3 ${HOME}/.quickemu/macrecovery" + web_get "https://raw.githubusercontent.com/wimpysworld/quickemu/master/chunkcheck" "${HOME}/.quickemu" + CHUNKCHECK="${HOME}/.quickemu/chunkcheck" fi - if [ -z "${MACRECOVERY}" ]; then - echo "ERROR! Can not find a usable macrecovery." - exit 1 + if [ -z "${CHUNKCHECK}" ]; then + read -p "ERROR! Can not find chunkcheck. Will not be able to verify image. Proceed anyway?" skipVerification + if [ "${skipVerification,,}" != "y" ] && [ "${skipVerification,,}" != "yes" ]; then + exit 1 + fi + echo 'Skipping verification' && skipVerification=true fi - # Get firmware - web_get "https://github.com/kholia/OSX-KVM/raw/master/OpenCore/OpenCore.qcow2" "${VM_PATH}" - web_get "https://github.com/kholia/OSX-KVM/raw/master/OVMF_CODE.fd" "${VM_PATH}" - if [ ! -e "${VM_PATH}/OVMF_VARS-1920x1080.fd" ]; then - web_get "https://github.com/kholia/OSX-KVM/raw/master/OVMF_VARS-1920x1080.fd" "${VM_PATH}" + OpenCore_qcow2="https://github.com/kholia/OSX-KVM/raw/master/OpenCore/OpenCore.qcow2" + OVMF_CODE="https://github.com/kholia/OSX-KVM/raw/master/OVMF_CODE.fd" + OVMF_VARS="https://github.com/kholia/OSX-KVM/raw/master/OVMF_VARS-1920x1080.fd" + + local appleSession=$(curl -v -H "Host: osrecovery.apple.com" -H "Connection: close" -A "InternetRecovery/1.0" http://osrecovery.apple.com/ 2>&1 | tr ';' '\n' | awk -F'session=|;' '{print $2}' | grep 1) + local info=$(curl -s -X POST -H "Host: osrecovery.apple.com" -H "Connection: close" -A "InternetRecovery/1.0" -b "session=\"${appleSession}\"" -H "Content-Type: text/plain"\ + -d $'cid='$(generate_id 16)$'\nsn='${MLB}$'\nbid='${BOARD_ID}$'\nk='$(generate_id 64)$'\nfg='$(generate_id 64)$'\nos='${OS_TYPE} \ + http://osrecovery.apple.com/InstallationPayload/RecoveryImage | tr ' ' '\n') + local downloadLink=$(echo "$info" | grep 'oscdn' | grep 'dmg') + local downloadSession=$(echo "$info" | grep 'expires' | grep 'dmg') + local chunkListLink=$(echo "$info" | grep 'oscdn' | grep 'chunklist') + local chunkListSession=$(echo "$info" | grep 'expires' | grep 'chunklist') + + if [ "${show_iso_url}" == 1 ]; then + echo -e "Recovery URL (inaccessible through normal browser):\n${downloadLink}\nChunklist (used for verifying the Recovery Image):\n${chunkListLink}\nFirmware URLs:\n${OpenCore_qcow2}\n${OVMF_CODE}\n${OVMF_VARS}" + exit 0 + elif [ "${test_iso_url}" == 1 ]; then + wget --spider --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${downloadSession}" "${downloadLink}" + wget --spider --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${chunkListSession}" "${chunkListLink}" + exit 0 + elif [ "${download_iso}" == 1 ]; then + echo "Downloading macOS ${RELEASE} from ${downloadLink}" + web_get "${downloadLink}" "${VM_PATH}" RecoveryImage.dmg --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${downloadSession}" + curl --progress-bar "${chunkListLink}" -o RecoveryImage.chunklist --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${chunkListSession}" + VM_PATH="$(pwd)" + else + echo "Downloading macOS firmware" + web_get "${OpenCore_qcow2}" "${VM_PATH}" + web_get "${OVMF_CODE}" "${VM_PATH}" + if [ ! -e "${VM_PATH}/OVMF_VARS-1920x1080.fd" ]; then + web_get "${OVMF_VARS}" "${VM_PATH}" + fi + + if [ ! -e "${VM_PATH}/RecoveryImage.chunklist" ]; then + echo "Downloading macOS ${RELEASE} from ${downloadLink}" + web_get "${downloadLink}" "${VM_PATH}" RecoveryImage.dmg --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${downloadSession}" + curl --progress-bar "${chunkListLink}" -o "${VM_PATH}/RecoveryImage.chunklist" --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${chunkListSession}" + fi fi - if [ ! -e "${VM_PATH}/RecoveryImage.chunklist" ]; then - echo "Downloading ${RELEASE}..." - ${MACRECOVERY} \ - --board-id "${BOARD_ID}" \ - --mlb "${MLB}" \ - --os-type "${OS_TYPE}" \ - --basename RecoveryImage \ - --outdir "${VM_PATH}" \ - download + if [ $skipVerification != true ]; then + if ! python3 "${CHUNKCHECK}" "${VM_PATH}" 2> /dev/null; then + echo "Verification failed." + exit 1 + fi + echo "Verified macOS ${RELEASE} image using chunklist." + else + echo "Skipping verification of image." fi if [ -e "${VM_PATH}/RecoveryImage.dmg" ] && [ ! -e "${VM_PATH}/RecoveryImage.img" ]; then @@ -2382,13 +2569,14 @@ function get_macos() { qemu-img convert "${VM_PATH}/RecoveryImage.dmg" -O raw "${VM_PATH}/RecoveryImage.img" 2>/dev/null fi + rm "${VM_PATH}/RecoveryImage.dmg" "${VM_PATH}/RecoveryImage.chunklist" make_vm_config RecoveryImage.img } function get_mageia() { local EDITION="${1:-}" local ISO=$(wget -q https://www.mageia.org/en/downloads/get/?q="Mageia-${RELEASE}-Live-${EDITION}-x86_64.iso" -O- | grep 'click here'| grep -o 'href=.*\.iso'|cut -d\" -f2) - local HASH=$(wget -q -O- "${ISO}.sha512" | cut -d' ' -f1) + local HASH=$(wget -q -O- "${ISO}.sha512" | cut_1) echo "${ISO} ${HASH}" } @@ -2407,16 +2595,13 @@ function get_manjaro() { esac [[ ${RELEASE} != "sway" ]] && MANIFEST="$(wget -qO- https://gitlab.manjaro.org/web/iso-info/-/raw/master/file-info.json)" - [[ ${EDITION} == "minimal" && ${TYPE} != "sway" ]] && EDITION=".minimal" || EDITION="" - if [[ ${RELEASE} != "sway" ]]; then URL="$(echo ${MANIFEST} | jq -r .${TYPE}.${RELEASE}${EDITION}.image)" else URL=$(echo ${MANIFEST} | jq -r '.[] | select(.name|test("^manjaro-sway-.*[.]iso$")) | select(.name|contains("unstable")|not) | .url') fi - - HASH=$(wget -qO- "${URL}.sha512" | cut -d' ' -f1) + HASH=$(wget -qO- "${URL}.sha512" | cut_1) echo "${URL} ${HASH}" } @@ -2431,7 +2616,7 @@ function get_mxlinux() { KDE) ISO="MX-${RELEASE}_KDE_x64.iso";; Fluxbox) ISO="MX-${RELEASE}_fluxbox_x64.iso";; esac - HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2439,7 +2624,8 @@ function get_netboot() { local ISO="netboot.xyz.iso" local HASH="" local URL="https://boot.netboot.xyz/ipxe" - HASH=$(wget -q -O- "${URL}/netboot.xyz-sha256-checksums.txt" | grep "${ISO}" | cut -d' ' -f1) + + HASH=$(wget -q -O- "${URL}/netboot.xyz-sha256-checksums.txt" | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2447,6 +2633,7 @@ function get_netbsd() { local HASH="" local ISO="NetBSD-${RELEASE}-amd64.iso" local URL="https://cdn.netbsd.org/pub/NetBSD/NetBSD-${RELEASE}/images/" + HASH=$(wget -q -O- "${URL}/MD5" | grep "${ISO}" | cut -d' ' -f4) echo "${URL}/${ISO} ${HASH}" } @@ -2471,7 +2658,8 @@ function get_nixos() { local HASH="" local ISO="latest-nixos-${EDITION}-x86_64-linux.iso" local URL="https://channels.nixos.org/nixos-${RELEASE}" - HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1) + + HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2479,6 +2667,7 @@ function get_openbsd() { local HASH="" local ISO="install${RELEASE//\./}.iso" local URL="https://mirror.leaseweb.com/pub/OpenBSD/${RELEASE}/amd64" + HASH=$(wget -q -O- "${URL}/SHA256" | grep "${ISO}" | cut -d' ' -f4) echo "${URL}/${ISO} ${HASH}" } @@ -2487,11 +2676,13 @@ function get_openindiana(){ local HASH="" local ISO="" local URL="" + URL="https://dlc.openindiana.org/isos/hipster/${RELEASE}" ISO="OI-hipster-${EDITION}-${RELEASE}.iso" - HASH=$(wget -q -O- "${URL}/${ISO}.sha256" |cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha256" |cut_1) echo "${URL}/${ISO} ${HASH}" } + function get_opensuse() { local HASH="" local ISO="" @@ -2510,7 +2701,7 @@ function get_opensuse() { ISO="openSUSE-Leap-${RELEASE}-DVD-x86_64-Current.iso" URL="https://download.opensuse.org/distribution/leap/${RELEASE}/iso" fi - HASH=$(wget -q -O- "${URL}/${ISO}.sha256" |awk '{if(NR==4) print $0}'|cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha256" |awk '{if(NR==4) print $0}'|cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2525,10 +2716,22 @@ function get_oraclelinux() { 7) ISO="OracleLinux-R${VER_MAJ}-U${VER_MIN}-Server-x86_64-dvd.iso";; *) ISO="OracleLinux-R${VER_MAJ}-U${VER_MIN}-x86_64-dvd.iso";; esac - HASH=$(wget -q -O- "https://linux.oracle.com/security/gpg/checksum/OracleLinux-R${VER_MAJ}-U${VER_MIN}-Server-x86_64.checksum" | grep "${ISO}" | cut -d' ' -f1) + HASH=$(wget -q -O- "https://linux.oracle.com/security/gpg/checksum/OracleLinux-R${VER_MAJ}-U${VER_MIN}-Server-x86_64.checksum" | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } +function get_parrotsec() { + local EDITION="${1:-}" + local HASH="" + local ISO="" + local URL="" + + ISO="Parrot-${EDITION}-${RELEASE}_amd64.iso" + URL="https://download.parrot.sh/parrot/iso/${RELEASE}" + HASH="$(wget -q -O- "${URL}"/signed-hashes.txt | grep "${ISO}" | cut_1)" + echo "${URL}/${ISO}" "${HASH}" +} + function get_peppermint() { local EDITION="${1:-}" local HASH="" @@ -2549,8 +2752,7 @@ function get_peppermint() { URL="${URL}/Gnome_FlashBack" ;; esac - - HASH=$(wget -q -O- "${URL}/${ISO}-sha512.checksum" | grep "${ISO}" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}-sha512.checksum" | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2559,6 +2761,7 @@ function get_popos() { local HASH="" local ISO="" local URL="" + URL=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq -r .url) HASH=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq -r .sha_sum) echo "${URL} ${HASH}" @@ -2566,6 +2769,7 @@ function get_popos() { function get_porteus() { local EDITION="${1:-}" + local edition="" local HASH="" local ISO="" local URL="" @@ -2573,7 +2777,18 @@ function get_porteus() { edition="${EDITION~~}" ISO="Porteus-${edition}-v${RELEASE}-x86_64.iso" URL="https://mirrors.dotsrc.org/porteus/x86_64/Porteus-v${RELEASE}" - HASH=$(wget -q -O- "${URL}/sha256sums.txt" | grep "${ISO}" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/sha256sums.txt" | grep "${ISO}" | cut_1) + echo "${URL}/${ISO} ${HASH}" +} + +function get_primtux() { + local HASH="" + local URL="" + local ISO="" + + ISO="PrimTux${RELEASE}-amd64-${EDITION}.iso" + URL="https://sourceforge.net/projects/primtux/files/Distribution" + HASH=$(wget -q -O- "${URL}/${ISO}.md5" | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2611,18 +2826,26 @@ function get_pureos() { function get_reactos() { local HASH="" local URL="" - local TMPURL="" + # no longer needed? + #local TMPURL="" - TMPURL=$(wget -q -S -O- --max-redirect=0 "https://sourceforge.net/projects/reactos/files/latest/download" 2>&1 | grep -i Location | cut -d' ' -f4) - URL=${TMPURL%\?*} + URL=$(curl -Lfs "https://sourceforge.net/projects/reactos/files/latest/download" -w %{url_effective} -o /this/is/a/nonexistent/directory/$RANDOM/$RANDOM) echo "${URL} ${HASH}" } +function get_rebornos() { + local ISO="" + local HASH="" + ISO=$(wget -q -O- "https://meta.cdn.soulharsh007.dev/RebornOS-ISO?format=json" | jq -r ".url") + HASH=$(wget -q -O- "https://meta.cdn.soulharsh007.dev/RebornOS-ISO?format=json" | jq -r ".md5") + echo "${ISO} ${HASH}" +} + function get_rockylinux() { local EDITION="${1:-}" if [[ "${RELEASE}" =~ ^8. ]] && [[ "${EDITION}" == "dvd" ]] then - EDITION="dvd1" + EDITION="dvd1" fi local HASH="" local ISO="Rocky-${RELEASE}-x86_64-${EDITION}.iso" @@ -2642,8 +2865,9 @@ function get_siduction() { local DATE="" local ISO="" local URL="https://mirrors.dotsrc.org/siduction/iso/Standing_on_the_Shoulders_of_Giants/${EDITION}" + DATE=$(wget -q -O- "${URL}"| grep .iso.md5 | cut -d'-' -f6 | cut -d'.' -f1) - HASH=$(wget -q -O- "${URL}/${ISO}.md5" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.md5" | cut_1) ISO="siduction-2023.1.1-Standing_on_the_Shoulders_of_Giants-${EDITION}-amd64-${DATE}.iso" echo "${URL}/${ISO} ${HASH}" } @@ -2652,17 +2876,65 @@ function get_slackware() { local HASH="" local ISO="slackware64-${RELEASE}-install-dvd.iso" local URL="https://slackware.nl/slackware/slackware-iso/slackware64-${RELEASE}-iso" - HASH=$(wget -q -O- "${URL}/${ISO}.md5" | cut -d' ' -f1) + + HASH=$(wget -q -O- "${URL}/${ISO}.md5" | cut_1) echo "${URL}/${ISO} ${HASH}" } +function get_slax() { + local HASH="" + local ISO="" + local URL="" + + case ${EDITION} in + debian) + URL="https://ftp.fi.muni.cz/pub/linux/slax/Slax-12.x" + ISO=$(wget -q -O- "${URL}/md5.txt" | grep '64bit-' | cut -d' ' -f3 | tail -n1) + HASH=$(wget -q -O- "${URL}/md5.txt" | grep '64bit-' | cut_1 | tail -n1) + ;; + slackware) + URL="https://ftp.fi.muni.cz/pub/linux/slax/Slax-15.x" + ISO=$(wget -q -O- "${URL}/md5.txt" | grep '64bit-' | cut -d' ' -f3 | tail -n1) + HASH=$(wget -q -O- "${URL}/md5.txt" | grep '64bit-' | cut_1 | tail -n1) + ;; + esac + echo "${URL}/${ISO} ${HASH}" +} + +function get_slint() { + local HASH="" + local ISO="" + local URL="" + + case ${RELEASE} in + 14.2.1) ISO="slint64-14.2.1.4.iso";; + 15.0) ISO="slint64-15.0-5.iso";; + esac + URL="https://slackware.uk/slint/x86_64/slint-${RELEASE}/iso" + HASH=$(wget -q -O- "${URL}"/${ISO}.sha256 | cut -d' ' -f4) + echo "${URL}/${ISO}" "${HASH}" +} + +function get_slitaz() { + local HASH="" + local ISO="slitaz-rolling-${RELEASE}" + local URL="http://mirror.slitaz.org/iso/rolling" + + case ${RELEASE} in + preferred) ISO="slitaz-rolling";; + *) ISO="slitaz-rolling-${RELEASE}";; + esac + HASH=$(wget -q -O- "${URL}/${ISO}.md5" | cut_1) + echo "${URL}/${ISO}.iso ${HASH}" +} + function get_solus() { local EDITION="${1:-}" local HASH="" local ISO="Solus-${RELEASE}-${EDITION}.iso" local URL="https://mirrors.rit.edu/solus/images/${RELEASE}" - HASH=$(wget -q -O- "${URL}/${ISO}.sha256sum" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha256sum" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2676,14 +2948,13 @@ function get_sparkylinux() { case ${EDITION} in minimalcli) URL="https://sourceforge.net/projects/sparkylinux/files/cli";; minimalgui) URL="https://sourceforge.net/projects/sparkylinux/files/base";; - *) URL="https://sourceforge.net/projects/sparkylinux/files/${EDITION}";; + *) URL="https://sourceforge.net/projects/sparkylinux/files/${EDITION}";; esac - - HASH=$(wget -q -O- ${URL}/${ISO}.allsums.txt | head -2 | grep 'iso' | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.allsums.txt" | head -2 | grep 'iso' | cut_1) echo "${URL}/${ISO}" "${HASH}" } -function get_spiral() { +function get_spirallinux() { local EDITION="${1:-}" local HASH="" local ISO="SpiralLinux_${EDITION}_12.231005_x86-64.iso" @@ -2716,7 +2987,7 @@ function get_tinycore() { URL="http://www.tinycorelinux.net/14.x/x86_64/release" fi - HASH=$(wget -q -O- "${URL}/${ISO}.md5.txt" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.md5.txt" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2727,40 +2998,38 @@ function get_trisquel() { local URL="https://mirrors.ocf.berkeley.edu/trisquel-images" case ${EDITION} in - mate) ISO="trisquel_${RELEASE}_amd64.iso";; - lxde) ISO="trisquel-mini_${RELEASE}_amd64.iso";; - kde) ISO="triskel_${RELEASE}_amd64.iso";; - sugar) ISO="trisquel-sugar_${RELEASE}_amd64.iso";; + mate) ISO="trisquel_${RELEASE}_amd64.iso";; + lxde) ISO="trisquel-mini_${RELEASE}_amd64.iso";; + kde) ISO="triskel_${RELEASE}_amd64.iso";; + sugar) ISO="trisquel-sugar_${RELEASE}_amd64.iso";; esac - HASH=$(wget -q -O- "${URL}/${ISO}.sha1" | grep "${ISO}" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha1" | grep "${ISO}" | cut_1) echo "${URL}/${ISO} ${HASH}" } function get_truenas-scale() { + local HASH="" local ISO="" local URL="" - local DLINFO="https://www.truenas.com/download-truenas-scale/" URL=$(wget -q ${DLINFO} -O- | grep -o "\"https://.*${RELEASE}.*\.iso\""|cut -d\" -f2) - HASH=$(wget -q ${URL}.sha256 -O- | cut -d' ' -f1 ) - + HASH=$(wget -q "${URL}.sha256" -O- | cut_1 ) echo "${URL} ${HASH}" } function get_truenas-core() { + local HASH="" local ISO="" local URL="" - local DLINFO="https://www.truenas.com/download-truenas-core/" URL=$(wget -q ${DLINFO} -O- | grep -o "\"https://.*${RELEASE}.*\.iso\""|cut -d\" -f2) - HASH=$(wget -q ${URL}.sha256 -O- | cut -d' ' -f1) + HASH=$(wget -q ${URL}.sha256 -O- | cut_1) echo "${URL} ${HASH}" } function get_ubuntu-server() { - local HASH="" local ISO="" local URL="" @@ -2776,11 +3045,11 @@ function get_ubuntu-server() { if wget -q --spider "${URL}/SHA256SUMS"; then DATA=$(wget -qO- "${URL}/SHA256SUMS" | grep 'live-server' | grep amd64 | grep iso) ISO=$(cut -d'*' -f2 <<<${DATA}) - HASH=$(cut -d' ' -f1 <<<${DATA}) + HASH=$(cut_1 <<<${DATA}) else DATA=$(wget -qO- "${URL}/MD5SUMS" | grep 'live-server' | grep amd64 | grep iso) ISO=$(cut -d' ' -f3 <<<${DATA}) - HASH=$(cut -d' ' -f1 <<<${DATA}) + HASH=$(cut_1 <<<${DATA}) fi if [ -z $ISO ] || [ -z $HASH ]; then @@ -2832,11 +3101,11 @@ function get_ubuntu() { if wget -q --spider "${URL}/SHA256SUMS"; then DATA=$(wget -qO- "${URL}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac") ISO=$(cut -d'*' -f2 <<<${DATA} | sed '1q;d') - HASH=$(cut -d' ' -f1 <<<${DATA} | sed '1q;d') + HASH=$(cut_1 <<<${DATA} | sed '1q;d') else DATA=$(wget -qO- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac") ISO=$(cut -d'*' -f2 <<<${DATA}) - HASH=$(cut -d' ' -f1 <<<${DATA}) + HASH=$(cut_1 <<<${DATA}) fi if [ -z $ISO ] || [ -z $HASH ]; then @@ -2857,6 +3126,18 @@ function get_ubuntu() { fi } +function get_vanillaos() { + # maybe use github api and dynamism for R2.0 but for 22.10 just + # hit their CDN + # + # https://cdn.vanillaos.org/assets/ISO/22.10-r8/VanillaOS-22.10-all.20230226.md5.txt + # https://cdn.vanillaos.org/assets/ISO/22.10-r8/VanillaOS-22.10-all.20230226.sha256.txt + local HASH=$(curl -s "https://cdn.vanillaos.org/assets/ISO/22.10-r8/VanillaOS-22.10-all.20230226.sha256.txt" | cut_1) + local URL="https://cdn.vanillaos.org/assets/ISO/22.10-r8/VanillaOS-22.10-all.20230226.iso" + + echo "${URL} ${HASH}" +} + function get_void() { local DATE="" local EDITION="${1:-}" @@ -2866,10 +3147,10 @@ function get_void() { DATE=$(wget -q -O- "${URL}/sha256sum.txt" | head -n1 | cut -d'.' -f1 | cut -d'-' -f4) case ${EDITION} in - glibc) ISO="void-live-x86_64-${DATE}-base.iso";; - musl) ISO="void-live-x86_64-musl-${DATE}-base.iso";; - xfce-glibc) ISO="void-live-x86_64-${DATE}-xfce.iso";; - xfce-musl) ISO="void-live-x86_64-musl-${DATE}-xfce.iso";; + glibc) ISO="void-live-x86_64-${DATE}-base.iso";; + musl) ISO="void-live-x86_64-musl-${DATE}-base.iso";; + xfce-glibc) ISO="void-live-x86_64-${DATE}-xfce.iso";; + xfce-musl) ISO="void-live-x86_64-musl-${DATE}-xfce.iso";; esac HASH="$(wget -q -O- "${URL}/sha256sum.txt" | grep "${ISO}" | cut -d' ' -f4)" echo "${URL}/${ISO} ${HASH}" @@ -2890,7 +3171,7 @@ function get_xerolinux() { local ISO="xerolinux-2022.12-x86_64.iso" local URL="https://sourceforge.net/projects/xerolinux/files/Releases" - HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1) + HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut_1) echo "${URL}/${ISO} ${HASH}" } @@ -2900,8 +3181,7 @@ function get_zorin() { local ISO="" local URL="" - # Parse out the iso URL from the redirector - URL=$(wget -q -S -O- --max-redirect=0 "https://zrn.co/${RELEASE}${EDITION}" 2>&1 | grep Location | cut -d' ' -f4) + URL=$(curl -Lfs "https://zrn.co/${RELEASE}${EDITION}" -w %{url_effective} -o /this/is/a/nonexistent/directory/$RANDOM/$RANDOM) echo "${URL} ${HASH}" } @@ -3192,7 +3472,6 @@ EOF handle_curl_error() { local error_code="$1" - local fatal_error_action=2 case "$error_code" in @@ -3217,18 +3496,18 @@ handle_curl_error() { 22) echo "Microsoft servers returned failing HTTP status code!" ;; - # POSIX defines exit statuses 1-125 as usable by us - # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02 - $((error_code <= 125))) - # Must be some other server error (possibly with this specific request/file) - # This is when accounting for all possible errors in the curl manual assuming a correctly formed curl command and HTTP(S) request, using only the curl features we're using, and a sane build + # POSIX defines exit statuses 1-125 as usable by us + # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02 + $((error_code <= 125))) + # Must be some other server error (possibly with this specific request/file) + # This is when accounting for all possible errors in the curl manual assuming a correctly formed curl command and HTTP(S) request, using only the curl features we're using, and a sane build echo "Server returned an error status!" ;; - 126 | 127) - echo "Curl command not found! Please install curl and try again. Exiting..." + 126 | 127) + echo "Curl command not found! Please install curl and try again. Exiting..." return "$fatal_error_action" ;; - # Exit statuses are undefined by POSIX beyond this point + # Exit statuses are undefined by POSIX beyond this point *) case "$(kill -l "$error_code")" in # Signals defined to exist by POSIX: @@ -3244,10 +3523,91 @@ handle_curl_error() { *) echo "Curl terminated due to a fatal signal!" ;; - esac + esac + esac + return 1 +} + +function download_windows-server() { + # Download enterprise evaluation windows versions + local windows_version="$1" + local enterprise_type="$2" + + local url="https://www.microsoft.com/en-us/evalcenter/download-$windows_version" + + local iso_download_page_html="$(curl --silent --location --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || { + handle_curl_error $? + return $? + } + + local CULTURE="" + local COUNTRY="" + local PRETTY_RELEASE="" + + case "$RELEASE" in + "10-ltsc") PRETTY_RELEASE="10 LTSC";; + "2012-r2") PRETTY_RELEASE="2012 R2";; + *) PRETTY_RELEASE="$RELEASE";; esac - return 1 + case "$LANG" in + "English (Great Britain)") + CULTURE="en-gb" + COUNTRY="GB";; + "Chinese (Simplified)") + CULTURE="zh-cn" + COUNTRY="CN";; + "Chinese (Traditional)") + CULTURE="zh-tw" + COUNTRY="TW";; + "French") + CULTURE="fr-fr" + COUNTRY="FR";; + "German") + CULTURE="de-de" + COUNTRY="DE";; + "Italian") + CULTURE="it-it" + COUNTRY="IT";; + "Japanese") + CULTURE="ja-jp" + COUNTRY="JP";; + "Korean") + CULTURE="ko-kr" + COUNTRY="KR";; + "Portuguese (Brazil)") + CULTURE="pt-br" + COUNTRY="BR";; + "Spanish") + CULTURE="es-es" + COUNTRY="ES";; + "Russian") + CULTURE="ru-ru" + COUNTRY="RU";; + *) + CULTURE="en-us" + COUNTRY="US";; + esac + + iso_download_links="$(echo "$iso_download_page_html" | grep -o "https://go.microsoft.com/fwlink/p/?LinkID=[0-9]\+&clcid=0x[0-9a-z]\+&culture=$CULTURE&country=$COUNTRY" | head -c 1024)" + + case "$enterprise_type" in + # Select x64 LTSC download link + "ltsc") iso_download_link=$(echo "$iso_download_links" | head -n 4 | tail -n 1);; + *) iso_download_link="$iso_download_links";; + esac + + iso_download_link="$(curl --silent --location --output /dev/null --silent --write-out "%{url_effective}" --head --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_download_link")" + + if [ "${COUNTRY}" != "US" ]; then + echo Downloading $(pretty_name "${OS}") ${PRETTY_RELEASE} in "${LANG}" from "$iso_download_link" + else + echo Downloading $(pretty_name "${OS}") ${PRETTY_RELEASE} from "$iso_download_link" + fi + + FILE_NAME="${iso_download_link##*/}" + web_get "$iso_download_link" "${VM_PATH}" "${FILE_NAME}" + OS="windows-server" } function download_windows() { @@ -3269,7 +3629,7 @@ function download_windows() { local url="https://www.microsoft.com/en-us/software-download/windows$windows_version" case "$windows_version" in - 8 | 10) url="${url}ISO";; + 8 | 10) url="${url}ISO";; esac local user_agent="Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0" @@ -3291,7 +3651,7 @@ function download_windows() { # tr: Filter for only numerics to prevent HTTP parameter injection # head -c was recently added to POSIX: https://austingroupbugs.net/view.php?id=407 local product_edition_id="$(echo "$iso_download_page_html" | grep -Eo '