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