#!/bin/bash VM_STORAGE=${1:-local-lvm} && \ pvesm list $VM_STORAGE >& /dev/null || { \ echo -e "\n\n\nERROR: '$VM_STORAGE' is not a valid storage ID.\n\n\n" && \ exit 1 } && \ VMID=$(cat<&/dev/null && \ qm importdisk $VMID ${FILE%".gz"} $VM_STORAGE 1>&/dev/null && \ echo -e "\n\n\n" \ "********************************\n" \ "* Completed Successfully *\n" \ "* New VM ID is $VMID *\n" \ "********************************\n"