From: Silvio Rhatto Date: Fri, 12 May 2017 17:17:35 +0000 (-0300) Subject: Fix SSH key file name at kvmx_up X-Git-Tag: 0.1.0~435 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=fdb4857ccb53574c8f3a4489efdbc96560e4522b;p=kvmx.git Fix SSH key file name at kvmx_up --- diff --git a/kvmx b/kvmx index 27ac049..30a0f1d 100755 --- 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