From 025886f92b9b83e757ffeac5179ae26516f1bee3 Mon Sep 17 00:00:00 2001 From: Daniel Lerps Date: Wed, 9 Mar 2022 18:55:24 +0100 Subject: [PATCH] Set default VM names in case there is no user input --- setup | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/setup b/setup index 18fe473..6f64fcb 100755 --- a/setup +++ b/setup @@ -50,6 +50,7 @@ TMPDIR=${SCRIPT_DIR}/tmp ISODIR=/var/lib/vz/template/iso/ HACKPXVERSION="3.2.0" OCVERSION="0.7.7" +DEFAULT_VM_PREFIX="HACK-" if [ `lscpu | grep "Vendor ID" | grep -i amd | wc -l` -eq 1 ]; then OSX_PLATFORM="AMD"; else OSX_PLATFORM="INTEL"; fi @@ -206,6 +207,8 @@ do echo "Enter VM Name: " read VM_NAME + if [ -z $VM_NAME ]; then VM_NAME="${DEFAULT_VM_PREFIX}HIGHSIERRA"; fi; + echo " " echo -n "Enter a disk size [INTEGER] [Default: 64 Gb]: " read SIZEDISK @@ -366,7 +369,7 @@ do fi - echo "Virtual machine created successfully." + echo "Virtual machine (${VM_NAME}) created successfully." echo " " echo "Access the Proxmox Web Panel to continue with the installation ..." echo "https://`ip address show vmbr0 | grep -w "inet" | awk -F " " '{ print $2 }' | awk -F "/" '{ print $1 }'`:8006" @@ -395,6 +398,8 @@ do echo "Enter VM Name: " read VM_NAME + if [ -z $VM_NAME ]; then VM_NAME="${DEFAULT_VM_PREFIX}MOJAVE"; fi; + echo " " echo -n "Enter a disk size [INTEGER] [Default: 64 Gb]: " read SIZEDISK @@ -555,7 +560,7 @@ do fi - echo "Virtual machine created successfully." + echo "Virtual machine (${VM_NAME}) created successfully." echo " " echo "Access the Proxmox Web Panel to continue with the installation ..." echo "https://`ip address show vmbr0 | grep -w "inet" | awk -F " " '{ print $2 }' | awk -F "/" '{ print $1 }'`:8006" @@ -584,6 +589,8 @@ do echo "Enter VM Name: " read VM_NAME + if [ -z $VM_NAME ]; then VM_NAME="${DEFAULT_VM_PREFIX}CATALINA"; fi; + echo " " echo -n "Enter a disk size [INTEGER] [Default: 64 Gb]: " read SIZEDISK @@ -744,7 +751,7 @@ do fi - echo "Virtual machine created successfully." + echo "Virtual machine (${VM_NAME}) created successfully." echo " " echo "Access the Proxmox Web Panel to continue with the installation ..." echo "https://`ip address show vmbr0 | grep -w "inet" | awk -F " " '{ print $2 }' | awk -F "/" '{ print $1 }'`:8006" @@ -773,6 +780,8 @@ do echo "Enter VM Name: " read VM_NAME + if [ -z $VM_NAME ]; then VM_NAME="${DEFAULT_VM_PREFIX}BIG-SUR"; fi; + echo " " echo -n "Enter a disk size [INTEGER] [Default: 64 Gb]: " read SIZEDISK @@ -933,7 +942,7 @@ do fi - echo "Virtual machine created successfully." + echo "Virtual machine (${VM_NAME}) created successfully." echo " " echo "Access the Proxmox Web Panel to continue with the installation ..." echo "https://`ip address show vmbr0 | grep -w "inet" | awk -F " " '{ print $2 }' | awk -F "/" '{ print $1 }'`:8006" @@ -962,6 +971,8 @@ do echo "Enter VM Name: " read VM_NAME + if [ -z $VM_NAME ]; then VM_NAME="${DEFAULT_VM_PREFIX}MONTEREY"; fi; + echo " " echo -n "Enter a disk size [INTEGER] [Default: 64 Gb]: " read SIZEDISK @@ -1122,7 +1133,7 @@ do fi - echo "Virtual machine created successfully." + echo "Virtual machine (${VM_NAME}) created successfully." echo " " echo "Access the Proxmox Web Panel to continue with the installation ..." echo "https://`ip address show vmbr0 | grep -w "inet" | awk -F " " '{ print $2 }' | awk -F "/" '{ print $1 }'`:8006"