From 607d9663222f868b9edc6bc34a29c9ba25fbb827 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 8 May 2025 12:57:27 +0200 Subject: [PATCH] Bugfix: Mikrotik & Pimox HAOS VM (NEXTID) (#4313) --- vm/mikrotik-routeros.sh | 7 ++++--- vm/pimox-haos-vm.sh | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/vm/mikrotik-routeros.sh b/vm/mikrotik-routeros.sh index 95ed5c82d..bf1f77c32 100644 --- a/vm/mikrotik-routeros.sh +++ b/vm/mikrotik-routeros.sh @@ -114,8 +114,8 @@ function msg_ok() { } function default_settings() { METHOD="default" - echo -e "${DGN}Using Virtual Machine ID: ${BGN}$NEXTID${CL}" - VMID=$NEXTID + VMID=$(get_valid_nextid) + echo -e "${DGN}Using Virtual Machine ID: ${BGN}$VMID${CL}" echo -e "${DGN}Using Hostname: ${BGN}mikrotik-routeros-chr${CL}" HN=mikrotik-routeros-chr echo -e "${DGN}Allocated Cores: ${BGN}1${CL}" @@ -136,7 +136,8 @@ function default_settings() { } function advanced_settings() { METHOD="advanced" - VMID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Virtual Machine ID" 8 58 $NEXTID --title "VIRTUAL MACHINE ID" 3>&1 1>&2 2>&3) + [ -z "${VMID:-}" ] && VMID=$(get_valid_nextid) + VMID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Virtual Machine ID" 8 58 $VMID --title "VIRTUAL MACHINE ID" 3>&1 1>&2 2>&3) exitstatus=$? if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Virtual Machine ID: ${BGN}$VMID${CL}" diff --git a/vm/pimox-haos-vm.sh b/vm/pimox-haos-vm.sh index 7441e6b22..8613ab982 100644 --- a/vm/pimox-haos-vm.sh +++ b/vm/pimox-haos-vm.sh @@ -137,8 +137,8 @@ function default_settings() { METHOD="default" echo -e "${DGN}Using HAOS Version: ${BGN}${STABLE}${CL}" BRANCH=${STABLE} - echo -e "${DGN}Using Virtual Machine ID: ${BGN}$NEXTID${CL}" - VMID=$NEXTID + VMID=$(get_valid_nextid) + echo -e "${DGN}Using Virtual Machine ID: ${BGN}$VMID${CL}" echo -e "${DGN}Using Hostname: ${BGN}haos${STABLE}${CL}" HN=haos${STABLE} echo -e "${DGN}Allocated Cores: ${BGN}2${CL}" @@ -166,10 +166,11 @@ function advanced_settings() { 3>&1 1>&2 2>&3) exitstatus=$? if [ $exitstatus = 0 ]; then echo -e "${DGN}Using HAOS Version: ${BGN}$BRANCH${CL}"; fi - VMID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Virtual Machine ID" 8 58 $NEXTID --title "VIRTUAL MACHINE ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3) + [ -z "${VMID:-}" ] && VMID=$(get_valid_nextid) + VMID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Virtual Machine ID" 8 58 $VMID --title "VIRTUAL MACHINE ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3) exitstatus=$? if [ -z $VMID ]; then - VMID="$NEXTID" + VMID="$VMID" echo -e "${DGN}Virtual Machine: ${BGN}$VMID${CL}" else if echo "$USEDID" | egrep -q "$VMID"; then