|
|
@ -36,9 +36,13 @@ function pretty_name() { |
|
|
|
case ${SIMPLE_NAME} in |
|
|
|
case ${SIMPLE_NAME} in |
|
|
|
elementary) PRETTY_NAME="elementary OS";; |
|
|
|
elementary) PRETTY_NAME="elementary OS";; |
|
|
|
freebsd) PRETTY_NAME="FreeBSD";; |
|
|
|
freebsd) PRETTY_NAME="FreeBSD";; |
|
|
|
|
|
|
|
kali) PRETTY_NAME="Kali";; |
|
|
|
linuxmint-cinnamon) PRETTY_NAME="Linux Mint Cinnamon";; |
|
|
|
linuxmint-cinnamon) PRETTY_NAME="Linux Mint Cinnamon";; |
|
|
|
linuxmint-mate) PRETTY_NAME="Linux Mint MATE";; |
|
|
|
linuxmint-mate) PRETTY_NAME="Linux Mint MATE";; |
|
|
|
linuxmint-xfce) PRETTY_NAME="Linux Mint XFCE";; |
|
|
|
linuxmint-xfce) PRETTY_NAME="Linux Mint XFCE";; |
|
|
|
|
|
|
|
nisos-gnome) PRETTY_NAME="NixOS Gnome";; |
|
|
|
|
|
|
|
nixos-plasma5) PRETTY_NAME="NixOS KDE";; |
|
|
|
|
|
|
|
nixos-minimal) PRETTY_NAME="Nixos Minimal";; |
|
|
|
macos) PRETTY_NAME="macOS";; |
|
|
|
macos) PRETTY_NAME="macOS";; |
|
|
|
openbsd) PRETTY_NAME="OpenBSD";; |
|
|
|
openbsd) PRETTY_NAME="OpenBSD";; |
|
|
|
opensuse) PRETTY_NAME="openSUSE";; |
|
|
|
opensuse) PRETTY_NAME="openSUSE";; |
|
|
@ -110,10 +114,14 @@ function os_support() { |
|
|
|
echo elementary \ |
|
|
|
echo elementary \ |
|
|
|
freebsd \ |
|
|
|
freebsd \ |
|
|
|
fedora \ |
|
|
|
fedora \ |
|
|
|
|
|
|
|
kali \ |
|
|
|
kubuntu \ |
|
|
|
kubuntu \ |
|
|
|
linuxmint-cinnamon \ |
|
|
|
linuxmint-cinnamon \ |
|
|
|
linuxmint-mate \ |
|
|
|
linuxmint-mate \ |
|
|
|
linuxmint-xfce \ |
|
|
|
linuxmint-xfce \ |
|
|
|
|
|
|
|
nixos-gnome \ |
|
|
|
|
|
|
|
nixos-plasma5 \ |
|
|
|
|
|
|
|
nixos-minimal \ |
|
|
|
lubuntu \ |
|
|
|
lubuntu \ |
|
|
|
macos \ |
|
|
|
macos \ |
|
|
|
openbsd \ |
|
|
|
openbsd \ |
|
|
@ -143,10 +151,19 @@ function releases_fedora(){ |
|
|
|
35_beta |
|
|
|
35_beta |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function releases_kali() { |
|
|
|
|
|
|
|
echo latest \ |
|
|
|
|
|
|
|
weekly |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function releases_linuxmint(){ |
|
|
|
function releases_linuxmint(){ |
|
|
|
echo 20.2 |
|
|
|
echo 20.2 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function releases_nixos(){ |
|
|
|
|
|
|
|
echo 21.05 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function releases_openbsd(){ |
|
|
|
function releases_openbsd(){ |
|
|
|
echo 7.0 |
|
|
|
echo 7.0 |
|
|
|
} |
|
|
|
} |
|
|
@ -453,6 +470,7 @@ function web_get() { |
|
|
|
local DIR="${2}" |
|
|
|
local DIR="${2}" |
|
|
|
local FILE="" |
|
|
|
local FILE="" |
|
|
|
local URL="${1}" |
|
|
|
local URL="${1}" |
|
|
|
|
|
|
|
|
|
|
|
if [ -n "${3}" ]; then |
|
|
|
if [ -n "${3}" ]; then |
|
|
|
FILE="${3}" |
|
|
|
FILE="${3}" |
|
|
|
else |
|
|
|
else |
|
|
@ -520,9 +538,15 @@ function make_vm_config() { |
|
|
|
elif [ "${OS}" == "fedora" ]; then |
|
|
|
elif [ "${OS}" == "fedora" ]; then |
|
|
|
GUEST="linux" |
|
|
|
GUEST="linux" |
|
|
|
IMAGE_TYPE="iso" |
|
|
|
IMAGE_TYPE="iso" |
|
|
|
|
|
|
|
elif [[ "${OS}" == *"kali"* ]]; then |
|
|
|
|
|
|
|
GUEST="linux" |
|
|
|
|
|
|
|
IMAGE_TYPE="iso" |
|
|
|
elif [[ "${OS}" == *"linuxmint"* ]]; then |
|
|
|
elif [[ "${OS}" == *"linuxmint"* ]]; then |
|
|
|
GUEST="linux" |
|
|
|
GUEST="linux" |
|
|
|
IMAGE_TYPE="iso" |
|
|
|
IMAGE_TYPE="iso" |
|
|
|
|
|
|
|
elif [[ "${OS}" == *"nixos"* ]]; then |
|
|
|
|
|
|
|
GUEST="linux" |
|
|
|
|
|
|
|
IMAGE_TYPE="iso" |
|
|
|
elif [ "${OS}" == "openbsd" ]; then |
|
|
|
elif [ "${OS}" == "openbsd" ]; then |
|
|
|
GUEST="openbsd" |
|
|
|
GUEST="openbsd" |
|
|
|
IMAGE_TYPE="iso" |
|
|
|
IMAGE_TYPE="iso" |
|
|
@ -622,6 +646,27 @@ function get_fedora() { |
|
|
|
make_vm_config "${ISO}" |
|
|
|
make_vm_config "${ISO}" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function get_kali() { |
|
|
|
|
|
|
|
local HASH="" |
|
|
|
|
|
|
|
local ISO="" |
|
|
|
|
|
|
|
local URL="" |
|
|
|
|
|
|
|
local SUBDIR="" |
|
|
|
|
|
|
|
validate_release "releases_kali" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "${RELEASE}" == "latest" ]]; then |
|
|
|
|
|
|
|
SUBDIR="current" |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
SUBDIR="kali-weeekly" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ISO=$(wget -q -O- "https://cdimage.kali.org/${SUBDIR}/?C=M;O=D" |grep -o ">kali-linux-.*-installer-amd64.iso"|head -n 1|cut -c 2-) |
|
|
|
|
|
|
|
HASH=$(wget -q -O- "https://cdimage.kali.org/${SUBDIR}/SHA256SUMS" | grep "${ISO}" | cut -d' ' -f1) |
|
|
|
|
|
|
|
URL="https://cdimage.kali.org/${SUBDIR}/${ISO}" |
|
|
|
|
|
|
|
web_get "${URL}" "${VM_PATH}" |
|
|
|
|
|
|
|
check_hash "${ISO}" "${HASH}" |
|
|
|
|
|
|
|
make_vm_config "${ISO}" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function get_linuxmint() { |
|
|
|
function get_linuxmint() { |
|
|
|
local FLAVOR="" |
|
|
|
local FLAVOR="" |
|
|
|
local HASH="" |
|
|
|
local HASH="" |
|
|
@ -637,7 +682,21 @@ function get_linuxmint() { |
|
|
|
check_hash "${ISO}" "${HASH}" |
|
|
|
check_hash "${ISO}" "${HASH}" |
|
|
|
make_vm_config "${ISO}" |
|
|
|
make_vm_config "${ISO}" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function get_nixos() { |
|
|
|
|
|
|
|
local FLAVOR="" |
|
|
|
|
|
|
|
local HASH="" |
|
|
|
|
|
|
|
local ISO="" |
|
|
|
|
|
|
|
local URL="" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
validate_release "releases_nixos" |
|
|
|
|
|
|
|
FLAVOR=$(echo "${OS}" | cut -d'-' -f2) |
|
|
|
|
|
|
|
ISO="latest-nixos-${FLAVOR}-x86_64-linux.iso" |
|
|
|
|
|
|
|
URL="https://channels.nixos.org/nixos-${RELEASE}/${ISO}" |
|
|
|
|
|
|
|
HASH=$(wget -q -O- "https://channels.nixos.org/nixos-${RELEASE}/${ISO}.sha256" | cut -d' ' -f1) |
|
|
|
|
|
|
|
web_get "${URL}" "${VM_PATH}" |
|
|
|
|
|
|
|
check_hash "${ISO}" "${HASH}" |
|
|
|
|
|
|
|
make_vm_config "${ISO}" |
|
|
|
|
|
|
|
} |
|
|
|
function get_openbsd() { |
|
|
|
function get_openbsd() { |
|
|
|
local HASH="" |
|
|
|
local HASH="" |
|
|
|
local ISO="" |
|
|
|
local ISO="" |
|
|
@ -899,8 +958,12 @@ if [ -n "${2}" ]; then |
|
|
|
get_freebsd |
|
|
|
get_freebsd |
|
|
|
elif [ "${OS}" == "fedora" ]; then |
|
|
|
elif [ "${OS}" == "fedora" ]; then |
|
|
|
get_fedora |
|
|
|
get_fedora |
|
|
|
|
|
|
|
elif [ "${OS}" == "kali" ]; then |
|
|
|
|
|
|
|
get_kali |
|
|
|
elif [[ "${OS}" == *"linuxmint"* ]]; then |
|
|
|
elif [[ "${OS}" == *"linuxmint"* ]]; then |
|
|
|
get_linuxmint |
|
|
|
get_linuxmint |
|
|
|
|
|
|
|
elif [[ "${OS}" == *"nixos"* ]]; then |
|
|
|
|
|
|
|
get_nixos |
|
|
|
elif [ "${OS}" == "openbsd" ]; then |
|
|
|
elif [ "${OS}" == "openbsd" ]; then |
|
|
|
get_openbsd |
|
|
|
get_openbsd |
|
|
|
elif [ "${OS}" == "opensuse" ]; then |
|
|
|
elif [ "${OS}" == "opensuse" ]; then |
|
|
@ -950,8 +1013,12 @@ else |
|
|
|
releases_freebsd |
|
|
|
releases_freebsd |
|
|
|
elif [ "${OS}" == "fedora" ]; then |
|
|
|
elif [ "${OS}" == "fedora" ]; then |
|
|
|
releases_fedora |
|
|
|
releases_fedora |
|
|
|
|
|
|
|
elif [ "${OS}" == "kali" ]; then |
|
|
|
|
|
|
|
releases_kali |
|
|
|
elif [[ "${OS}" == *"linuxmint"* ]]; then |
|
|
|
elif [[ "${OS}" == *"linuxmint"* ]]; then |
|
|
|
releases_linuxmint |
|
|
|
releases_linuxmint |
|
|
|
|
|
|
|
elif [[ "${OS}" == *"nixos"* ]]; then |
|
|
|
|
|
|
|
releases_nixos |
|
|
|
elif [ "${OS}" == "opensuse" ]; then |
|
|
|
elif [ "${OS}" == "opensuse" ]; then |
|
|
|
releases_opensuse |
|
|
|
releases_opensuse |
|
|
|
elif [ "${OS}" == "openbsd" ]; then |
|
|
|
elif [ "${OS}" == "openbsd" ]; then |
|
|
|