Refactor code
This commit is contained in:
parent
46af8a34b4
commit
be78536fed
10
install.sh
10
install.sh
@ -29,10 +29,10 @@ function msg() {
|
||||
}
|
||||
function cleanup() {
|
||||
popd >/dev/null
|
||||
rm -rf $TMP
|
||||
rm -rf $TEMP_DIR
|
||||
}
|
||||
TMP=`mktemp -d`
|
||||
pushd $TMP >/dev/null
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
pushd $TEMP_DIR >/dev/null
|
||||
|
||||
# Select storage location
|
||||
while read -r line; do
|
||||
@ -86,7 +86,7 @@ fi
|
||||
# Download Home Assistant disk image archive
|
||||
msg "Downloading disk image..."
|
||||
wget -q --show-progress $URL
|
||||
msg "\e[1A\e[0K\e[1A" #Overwrite output from wget
|
||||
echo -en "\e[1A\e[0K" #Overwrite output from wget
|
||||
FILE=$(basename $URL)
|
||||
|
||||
# Extract Home Assistant disk image
|
||||
@ -94,7 +94,7 @@ msg "Extracting disk image..."
|
||||
gunzip -f $FILE
|
||||
|
||||
# Create variables for container disk
|
||||
STORAGE_TYPE=`pvesm status -storage $STORAGE | awk 'NR>1 {print $2}'`
|
||||
STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
|
||||
if [ "$STORAGE_TYPE" = "dir" ]; then
|
||||
DISK_EXT=".qcow2"
|
||||
DISK_REF="$VMID/"
|
||||
|
Loading…
Reference in New Issue
Block a user