From 989580629a0856a0aa613c59479537e5d5c22dcc Mon Sep 17 00:00:00 2001 From: juronja <101410098+juronja@users.noreply.github.com> Date: Fri, 13 Feb 2026 13:12:41 +0000 Subject: [PATCH] preselect latest stable ISO fix --- vm/truenas-vm.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vm/truenas-vm.sh b/vm/truenas-vm.sh index 295dc6954..8d2447ade 100644 --- a/vm/truenas-vm.sh +++ b/vm/truenas-vm.sh @@ -293,16 +293,26 @@ function advanced_settings() { done ISOARRAY=() + local last_stable_index=0 + local current_item=0 + while read -r ISOPATH; do FILENAME=$(basename "$ISOPATH") ISOARRAY+=("$ISOPATH" "$FILENAME" "OFF") + if [[ ! "$FILENAME" =~ (RC|BETA) ]]; then + last_stable_index=$(((current_item * 3) + 2)) + fi + ((current_item++)) done < <(truenas_iso_lookup | sort -V) + + ISOARRAY[$last_stable_index]="ON" + if [ ${#ISOARRAY[@]} -eq 0 ]; then echo "No ISOs found." exit 1 fi - if SELECTED_ISO=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SELECT ISO TO INSTALL" --notags --radiolist "\nSelect version (BETA/RC + Latest stables):" 20 58 12 "${ISOARRAY[@]}" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then + if SELECTED_ISO=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SELECT ISO TO INSTALL" --notags --radiolist "\nSelect version (BETA/RC/Latest stable):" 20 58 12 "${ISOARRAY[@]}" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then echo -e "${ISO}${BOLD}${DGN}ISO Chosen: ${BGN}$(basename "$SELECTED_ISO")${CL}" else exit-script