]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Provision: start virtual machine if needed
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 1 Nov 2017 14:07:59 +0000 (12:07 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 1 Nov 2017 14:07:59 +0000 (12:07 -0200)
kvmx

diff --git a/kvmx b/kvmx
index f69a976c2b810877070cec18dde9c70c396a3112..a1e814a44e207873a95f426a588ab2b33f02d682 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -184,7 +184,7 @@ function __kvmx_initialize {
 
     mkdir -p $STATE_DIR $LOG_DIR
 
-    if [ ! -e "$image" ] && [ "$ACTION" != "up" ] && [ "$ACTION" != "purge" ] \
+    if [ ! -e "$image" ] && [ "$ACTION" != "up" ]      && [ "$ACTION" != "provision" ] && [ "$ACTION" != "purge" ] \
                          && [ "$ACTION" != "destroy" ] && [ "$ACTION" != "install" ]; then
       echo "$BASENAME: file not found: $image"
       exit 1
@@ -966,8 +966,9 @@ function kvmx_purge {
 # Provision a machine
 function kvmx_provision {
   if ! kvmx_running; then
-    echo "$BASENAME: guest $VM is not running"
-    exit 1
+    kvmx_up || exit 1
+    #echo "$BASENAME: guest $VM is not running"
+    #exit 1
   fi
 
   if [ -z "$provision_command" ]; then