Skip to content

Instantly share code, notes, and snippets.

@BR0kEN-
Created April 7, 2017 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BR0kEN-/cb75d55d74b998cc7ca9d9808e3c82c0 to your computer and use it in GitHub Desktop.
Save BR0kEN-/cb75d55d74b998cc7ca9d9808e3c82c0 to your computer and use it in GitHub Desktop.
Check VM state in Vagrantfile
VagrantEnv = Vagrant::Environment.new()
if "running" == (VagrantEnv.machine_index.find{|machine| machine.vagrantfile_path == VagrantEnv.cwd}).state
puts "Machine is running!"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment