Skip to content

Commit 607d966

Browse files
authored
Bugfix: Mikrotik & Pimox HAOS VM (NEXTID) (#4313)
1 parent 6929809 commit 607d966

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

vm/mikrotik-routeros.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ function msg_ok() {
114114
}
115115
function default_settings() {
116116
METHOD="default"
117-
echo -e "${DGN}Using Virtual Machine ID: ${BGN}$NEXTID${CL}"
118-
VMID=$NEXTID
117+
VMID=$(get_valid_nextid)
118+
echo -e "${DGN}Using Virtual Machine ID: ${BGN}$VMID${CL}"
119119
echo -e "${DGN}Using Hostname: ${BGN}mikrotik-routeros-chr${CL}"
120120
HN=mikrotik-routeros-chr
121121
echo -e "${DGN}Allocated Cores: ${BGN}1${CL}"
@@ -136,7 +136,8 @@ function default_settings() {
136136
}
137137
function advanced_settings() {
138138
METHOD="advanced"
139-
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)
139+
[ -z "${VMID:-}" ] && VMID=$(get_valid_nextid)
140+
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)
140141
exitstatus=$?
141142
if [ $exitstatus = 0 ]; then
142143
echo -e "${DGN}Using Virtual Machine ID: ${BGN}$VMID${CL}"

vm/pimox-haos-vm.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ function default_settings() {
137137
METHOD="default"
138138
echo -e "${DGN}Using HAOS Version: ${BGN}${STABLE}${CL}"
139139
BRANCH=${STABLE}
140-
echo -e "${DGN}Using Virtual Machine ID: ${BGN}$NEXTID${CL}"
141-
VMID=$NEXTID
140+
VMID=$(get_valid_nextid)
141+
echo -e "${DGN}Using Virtual Machine ID: ${BGN}$VMID${CL}"
142142
echo -e "${DGN}Using Hostname: ${BGN}haos${STABLE}${CL}"
143143
HN=haos${STABLE}
144144
echo -e "${DGN}Allocated Cores: ${BGN}2${CL}"
@@ -166,10 +166,11 @@ function advanced_settings() {
166166
3>&1 1>&2 2>&3)
167167
exitstatus=$?
168168
if [ $exitstatus = 0 ]; then echo -e "${DGN}Using HAOS Version: ${BGN}$BRANCH${CL}"; fi
169-
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)
169+
[ -z "${VMID:-}" ] && VMID=$(get_valid_nextid)
170+
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)
170171
exitstatus=$?
171172
if [ -z $VMID ]; then
172-
VMID="$NEXTID"
173+
VMID="$VMID"
173174
echo -e "${DGN}Virtual Machine: ${BGN}$VMID${CL}"
174175
else
175176
if echo "$USEDID" | egrep -q "$VMID"; then

0 commit comments

Comments
 (0)