Update install.sh

This commit is contained in:
whiskerz007 2019-03-13 16:56:53 +01:00 committed by GitHub
parent 4419ade7fb
commit ca78c0509f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ pvesm list $VM_STORAGE >& /dev/null || { \
echo -e "\n\n\nERROR: '$VM_STORAGE' is not a valid storage ID.\n\n\n" && \
exit 1
} && \
STORAGE_TYPE=`pvesm status -storage local | awk 'NR>1 {print $2}'` && \
VMID=$(cat<<EOF | python3
import json
with open('/etc/pve/.vmlist') as vmlist:
@ -53,7 +54,7 @@ echo -e "\n\n\n" \
VMDISK=vm-${VMID}-disk-
qm create $VMID -bios ovmf -name $(sed -e "s/\_//g" -e "s/.vdi.gz//" <<< $FILE) \
-net0 virtio,bridge=vmbr0 -onboot 1 -ostype l26 -scsihw virtio-scsi-pci && \
pvesm alloc $VM_STORAGE $VMID ${VMDISK}0 128 1>&/dev/null && \
pvesm alloc $VM_STORAGE $VMID ${VMDISK}0$(if [ "$STORAGE_TYPE" = "dir"]; then echo "qcow2";fi) 128 1>&/dev/null && \
qm importdisk $VMID ${FILE%".gz"} $VM_STORAGE 1>&/dev/null && \
qm set $VMID -bootdisk sata0 -efidisk0 ${VM_STORAGE}:${VMDISK}0,size=128K \
-sata0 ${VM_STORAGE}:${VMDISK}1,size=6G > /dev/null && \