os_homepages as case

This commit is contained in:
zenobit 2023-10-29 12:03:13 +01:00 committed by Martin Wimpress
parent 62ddfc3a2c
commit c52171e797

196
quickget
View file

@ -3,21 +3,23 @@ export LC_ALL=C
# Here the quick 'n dirty guide to adding a new OS to quickget # Here the quick 'n dirty guide to adding a new OS to quickget
# #
# 1. Update os_support() - add new OS, all lowercase # 1. Update os_support() - add new OS, all lowercase
# 2. Update pretty_name() - add a pretty name for new OS *only if the catch all is not suitable* # 2. Update pretty_name() - add a pretty name for new OS *only if the catch all is not suitable*
# 3. Create a releases_newos() generator (required) outputs the current supported release versions # 3. Update os_homepages() - add a homepage for new OS
# 4. Create a editions_newos() generator (optional) outputs the editions if new OS has multiple flavours/editions # 4. Create a releases_newos() generator (required) outputs the current supported release versions
# 5. Update make_vm_config() - add any *required* new OS tweaks # 5. Create a editions_newos() generator (optional) outputs the editions if new OS has multiple flavours/editions
# 6. Create a get_newos() function - that does something like this: # 6. Update make_vm_config() - add any *required* new OS tweaks
# function get_newos() { # 7. Create a get_newos() function - that does something like this:
# local EDITION="${1:-}"
# local HASH=""
# 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) #function get_newos() {
# echo "${URL}/${ISO} ${HASH}" # local EDITION="${1:-}"
# } # local HASH=""
# 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)
# echo "${URL}/${ISO} ${HASH}"
#}
function cleanup() { function cleanup() {
if [ -n "$(jobs -p)" ]; then if [ -n "$(jobs -p)" ]; then
@ -283,84 +285,90 @@ function os_support() {
} }
function os_homepages(){ function os_homepages(){
echo alma/https://almalinux.org/ \ local SIMPLE_NAME=""
alpine/https://alpinelinux.org/ \ local HOMEPAGE=""
android/https://www.android-x86.org/ \ SIMPLE_NAME="${1}"
antix/https://antixlinux.com/ \ case ${SIMPLE_NAME} in
archlinux/https://archlinux.org/ \ alma) HOMEPAGE="https://almalinux.org/";;
archcraft/https://archcraft.io/ \ alpine) HOMEPAGE="https://alpinelinux.org/";;
arcolinux/https://arcolinux.com/ \ android) HOMEPAGE="https://www.android-x86.org/";;
batocera/https://batocera.org/ \ antix) HOMEPAGE="https://antixlinux.com/";;
blendos/https://blendos.co/ \ archlinux) HOMEPAGE="https://archlinux.org/";;
bodhi/https://www.bodhilinux.com/ \ archcraft) HOMEPAGE="https://archcraft.io/";;
bunsenlabs/https://www.bunsenlabs.org/ \ arcolinux) HOMEPAGE="https://arcolinux.com/";;
cachyos/https://cachyos.org/ \ batocera) HOMEPAGE="https://batocera.org/";;
centos-stream/https://www.centos.org/centos-stream/ \ blendos) HOMEPAGE="https://blendos.co/";;
debian/https://www.debian.org/ \ bodhi) HOMEPAGE="https://www.bodhilinux.com/";;
deepin/https://www.deepin.org/ \ bunsenlabs) HOMEPAGE="https://www.bunsenlabs.org/";;
devuan/https://www.devuan.org/ \ cachyos) HOMEPAGE="https://cachyos.org/";;
dragonflybsd/https://www.dragonflybsd.org/ \ centos-stream) HOMEPAGE="https://www.centos.org/centos-stream/";;
edubuntu/https://www.edubuntu.org/ \ debian) HOMEPAGE="https://www.debian.org/";;
elementary/https://elementary.io/ \ deepin) HOMEPAGE="https://www.deepin.org/";;
endeavouros/https://endeavouros.com/ \ devuan) HOMEPAGE="https://www.devuan.org/";;
endless/https://www.endlessos.org/os \ dragonflybsd) HOMEPAGE="https://www.dragonflybsd.org/";;
fedora/https://www.fedoraproject.org/ \ edubuntu) HOMEPAGE="https://www.edubuntu.org/";;
freebsd/https://www.freebsd.org/ \ elementary) HOMEPAGE="https://elementary.io/";;
freedos/https://freedos.org/ \ endeavouros) HOMEPAGE="https://endeavouros.com/";;
garuda/https://garudalinux.org/ \ endless) HOMEPAGE="https://www.endlessos.org/os";;
gentoo/https://www.gentoo.org/ \ fedora) HOMEPAGE="https://www.fedoraproject.org/";;
ghostbsd/https://www.ghostbsd.org/ \ freebsd) HOMEPAGE="https://www.freebsd.org/";;
haiku/https://www.haiku-os.org/ \ freedos) HOMEPAGE="https://freedos.org/";;
holoiso/https://github.com/HoloISO/holoiso \ garuda) HOMEPAGE="https://garudalinux.org/";;
kali/https://www.kali.org/ \ gentoo) HOMEPAGE="https://www.gentoo.org/";;
kdeneon/https://neon.kde.org/ \ ghostbsd) HOMEPAGE="https://www.ghostbsd.org/";;
kolibrios/http://kolibrios.org/en/ \ haiku) HOMEPAGE="https://www.haiku-os.org/";;
kubuntu/https://kubuntu.org/ \ holoiso) HOMEPAGE="https://github.com/HoloISO/holoiso";;
linuxlite/https://www.linuxliteos.com/ \ kali) HOMEPAGE="https://www.kali.org/";;
linuxmint/https://linuxmint.com/ \ kdeneon) HOMEPAGE="https://neon.kde.org/";;
lmde/https://www.linuxmint.com/download_lmde.php \ kolibrios) HOMEPAGE="http://kolibrios.org/en/";;
mageia/https://www.mageia.org/ \ kubuntu) HOMEPAGE="https://kubuntu.org/";;
manjaro/https://manjaro.org/ \ linuxlite) HOMEPAGE="https://www.linuxliteos.com/";;
mxlinux/https://mxlinux.org/ \ linuxmint) HOMEPAGE="https://linuxmint.com/";;
netboot/https://netboot.xyz/ \ lmde) HOMEPAGE="https://www.linuxmint.com/download_lmde.php";;
netbsd/https://www.netbsd.org/ \ mageia) HOMEPAGE="https://www.mageia.org/";;
nixos/https://nixos.org/ \ manjaro) HOMEPAGE="https://manjaro.org/";;
lubuntu/https://lubuntu.me/ \ mxlinux) HOMEPAGE="https://mxlinux.org/";;
macos/https://www.apple.com/macos/ \ netboot) HOMEPAGE="https://netboot.xyz/";;
openbsd/https://www.openbsd.org/ \ netbsd) HOMEPAGE="https://www.netbsd.org/";;
openindiana/https://www.openindiana.org/ \ nixos) HOMEPAGE="https://nixos.org/";;
opensuse/https://www.opensuse.org/ \ lubuntu) HOMEPAGE="https://lubuntu.me/";;
oraclelinux/https://www.oracle.com/linux/ \ macos) HOMEPAGE="https://www.apple.com/macos/";;
peppermint/https://peppermintos.com/ \ openbsd) HOMEPAGE="https://www.openbsd.org/";;
popos/https://pop.system76.com/ \ openindiana) HOMEPAGE="https://www.openindiana.org/";;
porteus/http://www.porteus.org/ \ opensuse) HOMEPAGE="https://www.opensuse.org/";;
reactos/https://reactos.org/ \ oraclelinux) HOMEPAGE="https://www.oracle.com/linux/";;
rebornos/https://rebornos.org/ \ peppermint) HOMEPAGE="https://peppermintos.com/";;
rockylinux/https://rockylinux.org/ \ popos) HOMEPAGE="https://pop.system76.com/";;
siduction/https://siduction.org/ \ porteus) HOMEPAGE="http://www.porteus.org/";;
slackware/http://www.slackware.com/ \ reactos) HOMEPAGE="https://reactos.org/";;
solus/https://getsol.us/ \ rebornos) HOMEPAGE="https://rebornos.org/";;
spiral/https://spirallinux.github.io/ \ rockylinux) HOMEPAGE="https://rockylinux.org/";;
tails/https://tails.net/ \ siduction) HOMEPAGE="https://siduction.org/";;
tinycore/http://www.tinycorelinux.net/ \ slackware) HOMEPAGE="http://www.slackware.com/";;
trisquel/https://trisquel.info/ \ solus) HOMEPAGE="https://getsol.us/";;
truenas-core/https://www.truenas.com/truenas-core/ \ spiral) HOMEPAGE="https://spirallinux.github.io/";;
truenas-scale/https://www.truenas.com/truenas-scale/ \ tails) HOMEPAGE="https://tails.net/";;
ubuntu/https://ubuntu.com/ \ tinycore) HOMEPAGE="http://www.tinycorelinux.net/";;
ubuntu-budgie/https://ubuntubudgie.org/ \ trisquel) HOMEPAGE="https://trisquel.info/";;
ubuntucinnamon/https://ubuntucinnamon.org/ \ truenas-core) HOMEPAGE="https://www.truenas.com/truenas-core/";;
ubuntukylin/https://ubuntukylin.com/ \ truenas-scale) HOMEPAGE="https://www.truenas.com/truenas-scale/";;
ubuntu-mate/https://ubuntu-mate.org/ \ ubuntu) HOMEPAGE="https://ubuntu.com/";;
ubuntu-server/https://ubuntu.com/server \ ubuntu-budgie) HOMEPAGE="https://ubuntubudgie.org/";;
ubuntustudio/https://ubuntustudio.org/ \ ubuntucinnamon) HOMEPAGE="https://ubuntucinnamon.org/";;
ubuntu-unity/https://ubuntuunity.org/ \ ubuntukylin) HOMEPAGE="https://ubuntukylin.com/";;
vanillaos/https://vanillaos.org/ \ ubuntu-mate) HOMEPAGE="https://ubuntu-mate.org/";;
void/https://voidlinux.org/ \ ubuntu-server) HOMEPAGE="https://ubuntu.com/server";;
vxlinux/https://vxlinux.org/ \ ubuntustudio) HOMEPAGE="https://ubuntustudio.org/";;
windows/https://www.microsoft.com/en-us/windows/ \ ubuntu-unity) HOMEPAGE="https://ubuntuunity.org/";;
xerolinux/https://xerolinux.xyz/ \ vanillaos) HOMEPAGE="https://vanillaos.org/";;
xubuntu/https://xubuntu.org/ \ void) HOMEPAGE="https://voidlinux.org/";;
zorin/https://zorin.com/os/ 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}"
} }
function releases_alma() { function releases_alma() {
@ -2686,8 +2694,8 @@ if [ -n "${2}" ]; then
fi fi
else else
if [ "${open_distro_homepage}" == 'on' ]; then if [ "${open_distro_homepage}" == 'on' ]; then
homepage=$(os_homepages | sed 's/\s\+/\n/g' | grep ${OS} | cut -d'/' -f2-9) HOMEPAGE=$(os_homepages ${OS})
open_url "${homepage}" && exit 0 open_url "${HOMEPAGE}" && exit 0
fi fi
echo "ERROR! You must specify a release." echo "ERROR! You must specify a release."
case ${OS} in case ${OS} in