From 34e587362ba198f0647a206b884772323845ee63 Mon Sep 17 00:00:00 2001 From: img2tab <31696646+img2tab@users.noreply.github.com> Date: Thu, 3 Jan 2019 06:04:46 +0000 Subject: [PATCH] check for existing VM now has different codepath for Windows and Linux --- macos_okiomov.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/macos_okiomov.sh b/macos_okiomov.sh index bb2140a..4432e4c 100644 --- a/macos_okiomov.sh +++ b/macos_okiomov.sh @@ -97,7 +97,16 @@ fi # Finally done with dependencies. -if [ -n "$(VBoxManage showvminfo "${vmname}")" ]; then + +if [ -z "${windows}" ]; then + if VBoxManage list vms | grep -q "${vmname}"; then + echo "${vmname} virtual machine already exists. Exiting." + exit +elif [ -n "$(VBoxManage showvminfo "${vmname}")" ]; then + echo "${vmname} virtual machine already exists. Exiting." + exit +fi + echo "${vmname} virtual machine already exists. Exiting." exit fi