]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Test first for ssh_support at kvmx_ssh
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 15 Jun 2018 00:04:14 +0000 (21:04 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 15 Jun 2018 00:04:14 +0000 (21:04 -0300)
kvmx

diff --git a/kvmx b/kvmx
index 6386e7c2017b6d4b63d9e30ad952cdb201478357..9fb7788bebd6cb2adfbba5346191ebee5431e34b 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -630,6 +630,11 @@ function kvmx_usage {
 
 # Log into the guest using SSH
 function kvmx_ssh {
+  if [ "$ssh_support" != "y" ]; then
+    echo "$BASENAME: SSH support for $VM is disabled"
+    exit 1
+  fi
+
   if ! kvmx_running || kvmx_suspended; then
     echo "$BASENAME: $VM not running, trying to start it..."
     kvmx up $VM || exit 1
@@ -638,11 +643,6 @@ function kvmx_ssh {
     #exit 1
   fi
 
-  if [ "$ssh_support" != "y" ]; then
-    echo "$BASENAME: SSH support for $VM is disabled"
-    exit 1
-  fi
-
   # Shift params according to how the program was called:
   # either "kvmx ssh" or "kvmx ssh guest".
   #if [ "$ACTION" == "ssh" ]; then