Update install.sh

This commit is contained in:
colin 2024-08-12 09:38:26 -04:00
parent 35e54da30f
commit 5e2fb3421d
1 changed files with 14 additions and 8 deletions

View File

@ -8,7 +8,14 @@ IMG_URL=${1:-"https://cloud-images.ubuntu.com/noble/current/noble-server-cloudim
IMG_NAME=${2:-"noble-server-cloudimg-amd64.img"}
DISTRO=${3:-"ubuntu"} # Default to "ubuntu"
VERSION=${4:-"2404"} # Default to "2404"
STORAGE=${5:-"proxmox"} # Default to "proxmox"
STORAGE=${5:-"proxmox"} # Default to "proxmox"}
# Ask for starting VM ID if running with manual inputs
if [[ -z $1 ]]; then
read -p "Enter the starting VM ID (e.g., 8000): " STARTING_VM_ID
else
STARTING_VM_ID=8000
fi
check_command() {
if [ $? -ne 0 ]; then
@ -73,12 +80,11 @@ create_vm() {
}
# Create VMs with different memory configurations
create_vm 8100 "${DISTRO}-${VERSION}-512mb" 512
create_vm 8101 "${DISTRO}-${VERSION}-1gb" 1024
create_vm 8102 "${DISTRO}-${VERSION}-2gb" 2048
create_vm 8103 "${DISTRO}-${VERSION}-4gb" 4096
create_vm 8104 "${DISTRO}-${VERSION}-8gb" 8192
create_vm 8105 "${DISTRO}-${VERSION}-12gb" 12288
create_vm $STARTING_VM_ID "${DISTRO}-${VERSION}-512mb" 512
create_vm $((STARTING_VM_ID + 1)) "${DISTRO}-${VERSION}-1gb" 1024
create_vm $((STARTING_VM_ID + 2)) "${DISTRO}-${VERSION}-2gb" 2048
create_vm $((STARTING_VM_ID + 3)) "${DISTRO}-${VERSION}-4gb" 4096
create_vm $((STARTING_VM_ID + 4)) "${DISTRO}-${VERSION}-8gb" 8192
create_vm $((STARTING_VM_ID + 5)) "${DISTRO}-${VERSION}-12gb" 12288
echo "All VMs created successfully!"