Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct basic error to get to downloading isos #617

Merged
merged 2 commits into from
Jan 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 40 additions & 17 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ function pretty_name() {
popos) PRETTY_NAME="Pop!_OS";;
reactos) PRETTY_NAME="ReactOS";;
rockylinux) PRETTY_NAME="Rocky Linux";;
truenas-core) PRETTY_NAME="TrueNAS Core";;
truenas-scale) PRETTY_NAME="TrueNAS Scale";;
ubuntu-budgie) PRETTY_NAME="Ubuntu Budgie";;
ubuntukylin) PRETTY_NAME="Ubuntu Kylin";;
ubuntu-mate) PRETTY_NAME="Ubuntu MATE";;
ubuntustudio) PRETTY_NAME="Ubuntu Studio";;
ubuntu-unity) PRETTY_NAME="Ubuntu Unity";;
void) PRETTY_NAME="Void Linux";;
zorin) PRETTY_NAME="Zorin OS";;
truenas) PRETTY_NAME="TrueNAS";;
*) PRETTY_NAME="${SIMPLE_NAME^}";;
esac
echo "${PRETTY_NAME}"
Expand Down Expand Up @@ -207,7 +208,8 @@ function os_support() {
slackware \
solus \
tails \
truenas \
truenas-core \
truenas-scale \
ubuntu \
ubuntu-budgie \
ubuntukylin \
Expand Down Expand Up @@ -497,12 +499,19 @@ function releases_tails() {
echo stable
}

function editions_truenas() {
echo core scale # enterprise is proprietary and paid
function releases_truenas() {
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
}

function releases_truenas() {
echo 22.12 13.0
function releases_truenas-scale() {
echo 22.02 22.12
}

function releases_ubuntu() {
Expand Down Expand Up @@ -774,7 +783,7 @@ function make_vm_config() {
reactos)
GUEST="reactos"
IMAGE_TYPE="iso";;
truenas)
truenas*)
GUEST="truenas"
IMAGE_TYPE="iso";;
windows)
Expand Down Expand Up @@ -827,12 +836,13 @@ EOF
echo "disk_size=\"2G\"" >> "${CONF_FILE}"
echo "ram=\"128M\"" >> "${CONF_FILE}"
;;
truenas)
truenas-scale|truenas-core)
echo
echo "boot=\"legacy\"" >> "${CONF_FILE}"
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
;;
zorin)
case ${EDITION} in
Expand Down Expand Up @@ -1485,15 +1495,27 @@ function get_tails() {
echo "${URL} ${HASH}"
}

function get_truenas() {
function get_truenas-scale() {
local ISO=""
local URL=""

if [ "${RELEASE}" == "13.0" ] && [ "${OS}" == "CORE" ]; then
URL="$(wget https://download.freenas.org/13.0/STABLE/U3.1/x64/${OS}.iso)"
elif [ "${RELEASE}" == "22.12" ] && [ "${OS}" == "SCALE" ]; then
URL="$(https://download.truenas.com/TrueNAS-SCALE-Bluefin/${RELEASE}.0/TrueNAS-${OS}-22.12.0.iso)"
fi
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 )

echo "${URL} ${HASH}"
}

function get_truenas-core() {
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)

echo "${URL} ${HASH}"
}

function get_ubuntu() {
Expand Down Expand Up @@ -2049,6 +2071,7 @@ if [ -n "${2}" ]; then
fi
fi


VM_PATH="${OS}-${RELEASE}-${EDITION}"
validate_release "releases_${OS}"
create_vm "$("get_${OS}" "${EDITION}")"
Expand Down