]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Use rsync to copy image files, falling back to cp
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 2 Apr 2017 17:22:54 +0000 (14:22 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 2 Apr 2017 17:22:54 +0000 (14:22 -0300)
kvmx

diff --git a/kvmx b/kvmx
index cdd0d390ad28a6313e7cac3b36a605e6dbfcc893..5cf833c507ab5a14b1c494fafb465e3d09afb94e 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -244,7 +244,11 @@ function kvmx_up {
         fi
 
         echo "Copying base image $baseimage to $image..."
-        cp $baseimage $image
+        if which rsync &> /dev/null; then
+          rsync -ah --progress $baseimage $image
+        else
+          cp $baseimage $image
+        fi
 
         if [ -e "$basekey" ]; then
           imagekey="`dirname $image`/ssh/`basename $image .img`.key"