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

diff --git a/kvmx b/kvmx
index 27ac049c37428084c1e971501f5cb952cc4c99a8..30a0f1db91eefa141b7e888e58e76623b18a3218 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="`dirname $baseimage`/ssh/`basename $baseimage .img`.key"
+        basekey="$(ls `dirname $baseimage`/ssh/*.key)"
 
         if [ ! -e "$baseimage" ]; then
           echo "$BASENAME: could not find basebox $baseimage. Please create it first."
@@ -279,9 +279,10 @@ function kvmx_up {
           cp $baseimage $image
         fi
 
+        echo $basekey
         if [ -e "$basekey" ]; then
           imagekey="`dirname $image`/ssh/`basename $image .img`.key"
-          mkdir "`dirname $image`/ssh"
+          mkdir -p "`dirname $image`/ssh"
 
           cp $basekey     $imagekey
           cp $basekey.pub $imagekey.pub