diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-12-31 01:34:24 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-12-31 01:34:24 +0300 |
commit | 13e4208d87e4bf3597e30946873088372d7aa5a8 (patch) | |
tree | e7a89a885df966b35466af1d74e7e4a2ce1c4c2e | |
parent | 6d0bc6bbd97ed7515eec72b4ad1f33951430a218 (diff) |
build: fix VM image name
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rwxr-xr-x | build-VM.sh | 9 | ||||
-rw-r--r-- | buildlib.sh | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/build-VM.sh b/build-VM.sh index 656db373..a5c85980 100755 --- a/build-VM.sh +++ b/build-VM.sh @@ -14,7 +14,10 @@ source buildlib.sh IP=${1:-192.168.0.145} # For QEMU automated testing (optional) SIZE=3G # Raspbian image size #CLEAN=0 # Pass this envvar to skip cleaning download cache -IMG="NextCloudPi_RPi_$( date "+%m-%d-%y" ).img" +IMG="NextCloudPi_VM_$( date "+%m-%d-%y" ).img" +IMG=tmp/"$IMG" +VM="/var/lib/libvirt/images/nextcloudpi_default.img" + TAR=output/"$( basename "$IMG" .img ).tar.bz2" test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; } @@ -23,10 +26,6 @@ test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; } ## preparations -IMG="NextCloudPi_VM_$( date "+%m-%d-%y" ).img" -IMG=tmp/"$IMG" -VM="/var/lib/libvirt/images/nextcloudpi_default.img" - test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; } set -e prepare_dirs # tmp cache output diff --git a/buildlib.sh b/buildlib.sh index c7464d5c..9fc1b568 100644 --- a/buildlib.sh +++ b/buildlib.sh @@ -331,7 +331,7 @@ function upload_ftp() echo -e "\n\e[1m[ Upload FTP ]\e[0m" echo "* $IMGNAME..." [[ -f torrent/"$IMGNAME"/"$IMGNAME".tar.bz2 ]] || { echo "No image file found, abort"; return 1; } - [[ "$FTPPASS" == "" ]] && { echo "No FTPPASS variable found, abort"; return 0; } + [[ "$FTPPASS" == "" ]] && { echo "No FTPPASS variable found, abort"; return 2; } cd torrent @@ -371,7 +371,7 @@ upload_all() mkdir -p archive for img in $(find output -name '*.tar.bz2'); do - upload_ftp "${img}" && mv "${img}" archive + upload_ftp "$(basename ${img} .tar.bz2)" && mv "${img}" archive done } |