Update 'test.sh'
This commit is contained in:
parent
3ad0643344
commit
6cd44f7a15
22
test.sh
22
test.sh
@ -289,17 +289,17 @@ else
|
|||||||
"${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
"${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
msg_ok "Using ${CL}${BL}$STORAGE${CL} ${GN}for Storage Location."
|
# msg_ok "Using ${CL}${BL}$STORAGE${CL} ${GN}for Storage Location."
|
||||||
msg_ok "Virtual Machine ID is ${CL}${BL}$VMID${CL}."
|
# msg_ok "Virtual Machine ID is ${CL}${BL}$VMID${CL}."
|
||||||
msg_info "Getting URL for Home Assistant ${BRANCH} Disk Image"
|
msg_info "Getting URL for Home Assistant ${BRANCH} Disk Image"
|
||||||
URL=https://github.com/home-assistant/operating-system/releases/download/${BRANCH}/haos_ova-${BRANCH}.qcow2.xz
|
URL=https://github.com/home-assistant/operating-system/releases/download/${BRANCH}/haos_ova-${BRANCH}.qcow2.xz
|
||||||
sleep 2
|
sleep 2
|
||||||
msg_ok "${CL}${BL}${URL}${CL}"
|
# msg_ok "${CL}${BL}${URL}${CL}"
|
||||||
wget -q --show-progress $URL
|
wget -q --show-progress $URL
|
||||||
echo -en "\e[1A\e[0K"
|
# echo -en "\e[1A\e[0K"
|
||||||
FILE=$(basename $URL)
|
FILE=$(basename $URL)
|
||||||
msg_ok "Downloaded ${CL}${BL}haos_ova-${BRANCH}.qcow2.xz${CL}"
|
msg_ok "Downloaded ${CL}${BL}haos_ova-${BRANCH}.qcow2.xz${CL}"
|
||||||
msg_info "Extracting KVM Disk Image"
|
# msg_info "Extracting KVM Disk Image"
|
||||||
unxz $FILE
|
unxz $FILE
|
||||||
STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
|
STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
|
||||||
case $STORAGE_TYPE in
|
case $STORAGE_TYPE in
|
||||||
@ -322,9 +322,9 @@ for i in {0,1}; do
|
|||||||
eval DISK${i}=vm-${VMID}-disk-${i}${DISK_EXT:-}
|
eval DISK${i}=vm-${VMID}-disk-${i}${DISK_EXT:-}
|
||||||
eval DISK${i}_REF=${STORAGE}:${DISK_REF:-}${!disk}
|
eval DISK${i}_REF=${STORAGE}:${DISK_REF:-}${!disk}
|
||||||
done
|
done
|
||||||
msg_ok "Extracted KVM Disk Image"
|
# msg_ok "Extracted KVM Disk Image"
|
||||||
|
|
||||||
msg_info "Creating HAOS VM"
|
# msg_info "Creating HAOS VM"
|
||||||
qm create $VMID -agent 1 -bios ovmf -cores $CORE_COUNT -memory $RAM_SIZE -name $VM_NAME -net0 virtio,bridge=$BRG,macaddr=$MAC$VLAN \
|
qm create $VMID -agent 1 -bios ovmf -cores $CORE_COUNT -memory $RAM_SIZE -name $VM_NAME -net0 virtio,bridge=$BRG,macaddr=$MAC$VLAN \
|
||||||
-onboot 1 -ostype l26 -scsihw virtio-scsi-pci
|
-onboot 1 -ostype l26 -scsihw virtio-scsi-pci
|
||||||
pvesm alloc $STORAGE $VMID $DISK0 4M 1>&/dev/null
|
pvesm alloc $STORAGE $VMID $DISK0 4M 1>&/dev/null
|
||||||
@ -336,11 +336,11 @@ qm set $VMID \
|
|||||||
-boot order=scsi0 >/dev/null
|
-boot order=scsi0 >/dev/null
|
||||||
qm set $VMID -description "# Home Assistant OS
|
qm set $VMID -description "# Home Assistant OS
|
||||||
### https://github.com/tteck/Proxmox" >/dev/null
|
### https://github.com/tteck/Proxmox" >/dev/null
|
||||||
msg_ok "Created HAOS VM ${CL}${BL}${VM_NAME}"
|
# msg_ok "Created HAOS VM ${CL}${BL}${VM_NAME}"
|
||||||
|
|
||||||
if [ "$START_VM" == "yes" ]; then
|
if [ "$START_VM" == "yes" ]; then
|
||||||
msg_info "Starting Home Assistant OS VM"
|
# msg_info "Starting Home Assistant OS VM"
|
||||||
qm start $VMID
|
qm start $VMID
|
||||||
msg_ok "Started Home Assistant OS VM"
|
# msg_ok "Started Home Assistant OS VM"
|
||||||
fi
|
fi
|
||||||
msg_ok "Completed Successfully!\n"
|
echo -e "Completed Successfully!"
|
Loading…
x
Reference in New Issue
Block a user