Last active
October 10, 2021 07:49
-
-
Save Mearman/2660075bd95afde886536d6a7cf60c9b to your computer and use it in GitHub Desktop.
HAss OS Image download and decompress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -x | |
| # find the latest version here: https://github.com/home-assistant/operating-system/releases | |
| VERSION="6.5" | |
| # ---------- | |
| IMAGE_NAME="haos_ova-$VERSION" | |
| IMAGE_FILE="$IMAGE_NAME.qcow2" | |
| COMPRESSED_IMAGE="$IMAGE_FILE.xz" | |
| DESTIONATION="/mnt/user/domains/$IMAGE_NAME" | |
| # ---------- | |
| mkdir "/mnt/user/domains/$IMAGE_NAME" | |
| cd "/mnt/user/domains/$IMAGE_NAME" | |
| if [ -f "$DESTIONATION/$COMPRESSED_IMAGE" ]; then | |
| echo "$COMPRESSED_IMAGE already exists" | |
| echo "not downloading again" | |
| else | |
| echo "$COMPRESSED_IMAGE does not exist. Downloading" | |
| wget "https://github.com/home-assistant/operating-system/releases/download/$VERSION/$COMPRESSED_IMAGE" -O "$DESTIONATION/$COMPRESSED_IMAGE" | |
| fi | |
| unxz -v "$DESTIONATION/$COMPRESSED_IMAGE" | |
| qemu-img resize "$DESTIONATION/$IMAGE_FILE" 32G |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment