Skip to content

Commit

Permalink
kiss-vm: host fix --saveimage option bug
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhong Yin <[email protected]>
  • Loading branch information
tcler committed Apr 23, 2024
1 parent a953d98 commit 6d130cb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions kiss-vm
Original file line number Diff line number Diff line change
Expand Up @@ -3992,19 +3992,20 @@ elif [[ "$InstallType" = import ]]; then
[[ -f $Imageurl ]] && Imageurl=file://$(readlink -f ${Imageurl})
imagefilename=${Imageurl##*/}
imagefile=$VMpath/$imagefilename
[[ -n "$SAVE_IMAGE" || "$DOWNLOAD_ONLY" = yes ]] && imagefile=${DownloadImagePath%/}/${imagefilename}
dlimagefile=$imagefile
[[ -n "$SAVE_IMAGE" || "$DOWNLOAD_ONLY" = yes ]] && dlimagefile=${DownloadImagePath%/}/${imagefilename}

echo "{VM:INFO} downloading cloud image file of $Distro to $imagefile ..."
echo "{VM:INFO} downloading cloud image file of $Distro to $dlimagefile ..."
if [[ -b "$Imageurl" ]]; then
imagefile=$Imageurl
elif [[ $Imageurl != file:///* ]]; then
if [[ -n "$SAVE_IMAGE" ]]; then
curl_download_x ${DownloadImagePath}/${imagefilename} $Imageurl
curl_download_x ${dlimagefile} $Imageurl
[[ "$DOWNLOAD_ONLY" = yes ]] && {
ls -l ${DownloadImagePath}/${imagefilename}
ls -l ${dlimagefile}
cleanup_and_exit 0
}
cp ${DownloadImagePath}/${imagefilename} $imagefile
cp ${dlimagefile} $imagefile
else
curl_download_x $imagefile $Imageurl
fi
Expand Down

0 comments on commit 6d130cb

Please sign in to comment.