]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Fix dest SSH key file names at kvmx_up
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 12 May 2017 17:29:36 +0000 (14:29 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 12 May 2017 17:29:36 +0000 (14:29 -0300)
kvmx

diff --git a/kvmx b/kvmx
index 4eba46ddfa1cb2c3c1ef3174a3a6e411069f3df4..2a11eafaffb13887befce1b6e22426df3b7d72d5 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -265,7 +265,7 @@ function kvmx_up {
     if [ ! -z "$basebox" ]; then
       if [ -e "$GLOBAL_USER_CONFIG_FOLDER/$basebox" ]; then
         baseimage="`kvmx list_image $basebox`"
-        basekey="$(ls `dirname $baseimage`/ssh/*.key)"
+        basekey="$(ls `dirname $baseimage`/ssh/$basebox.key)"
 
         if [ ! -e "$baseimage" ]; then
           echo "$BASENAME: could not find basebox $baseimage. Please create it first."
@@ -280,7 +280,8 @@ function kvmx_up {
         fi
 
         if [ -e "$basekey" ]; then
-          imagekey="`dirname $image`/ssh/`basename $image .img`.key"
+          vmname="$(basename `dirname $image`)"
+          imagekey="`dirname $image`/ssh/$vmname.key"
           mkdir -p "`dirname $image`/ssh"
 
           cp $basekey     $imagekey