aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-11-01 12:07:59 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-11-01 12:07:59 -0200
commit1424d9116318e472874cc6df36d128db064d3f37 (patch)
treec2cf5b3b9704deb957e6ab1a7e52758a4a3f693f
parent083ae4169213e09218b1a354463dfc472922183b (diff)
downloadkvmx-1424d9116318e472874cc6df36d128db064d3f37.tar.gz
kvmx-1424d9116318e472874cc6df36d128db064d3f37.tar.bz2
Provision: start virtual machine if needed
-rwxr-xr-xkvmx7
1 files changed, 4 insertions, 3 deletions
diff --git a/kvmx b/kvmx
index f69a976..a1e814a 100755
--- 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