From f6816052bb50c06f81106d328d9f4ba884e5d343 Mon Sep 17 00:00:00 2001 From: whiskerz007 <2713522+whiskerz007@users.noreply.github.com> Date: Mon, 4 Jan 2021 21:48:12 +0100 Subject: [PATCH] Add support for multiple file compressions (#98) --- install.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index d2b4974..422e5b2 100644 --- a/install.sh +++ b/install.sh @@ -81,7 +81,7 @@ info "Container ID is $VMID." # Get latest Home Assistant disk image archive URL msg "Getting URL for latest Home Assistant disk image..." -RELEASE_EXT=vmdk.gz +RELEASE_TYPE=vmdk URL=$(cat<1 {print $2}') @@ -127,11 +131,11 @@ done # Create VM msg "Creating VM..." -VM_NAME=$(sed -e "s/\_//g" -e "s/.${RELEASE_EXT}//" <<< $FILE) +VM_NAME=$(sed -e "s/\_//g" -e "s/.${RELEASE_TYPE}.*$//" <<< $FILE) qm create $VMID -agent 1 -bios ovmf -name $VM_NAME -net0 virtio,bridge=vmbr0 \ -onboot 1 -ostype l26 -scsihw virtio-scsi-pci pvesm alloc $STORAGE $VMID $DISK0 128 1>&/dev/null -qm importdisk $VMID ${FILE%".gz"} $STORAGE ${IMPORT_OPT:-} 1>&/dev/null +qm importdisk $VMID ${FILE%.*} $STORAGE ${IMPORT_OPT:-} 1>&/dev/null qm set $VMID \ -efidisk0 ${DISK0_REF},size=128K \ -sata0 ${DISK1_REF},size=6G > /dev/null