Update haos-vm.sh

code refactoring
This commit is contained in:
tteckster 2023-05-18 17:06:08 -04:00 committed by GitHub
parent f80821cf7b
commit db8d22f721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 13 deletions

View File

@ -168,9 +168,7 @@ function advanced_settings() {
if VMID=$(whiptail --inputbox "Set Virtual Machine ID" 8 58 $NEXTID --title "VIRTUAL MACHINE ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
if [ -z "$VMID" ]; then
VMID="$NEXTID"
echo -e "${DGN}Virtual Machine ID: ${BGN}$VMID${CL}"
break
else
fi
if pct status "$VMID" &>/dev/null || qm status "$VMID" &>/dev/null; then
echo -e "${CROSS}${RD} ID $VMID is already in use${CL}"
sleep 2
@ -178,7 +176,6 @@ function advanced_settings() {
fi
echo -e "${DGN}Virtual Machine ID: ${BGN}$VMID${CL}"
break
fi
else
exit-script
fi