Class: VagrantPlugins::GuestNetBSD::Cap::Halt

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-guest-netbsd/cap/halt.rb

Class Method Summary collapse

Class Method Details

.halt(machine) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/vagrant-guest-netbsd/cap/halt.rb', line 5

def self.halt(machine)
  begin
    machine.communicate.sudo("/sbin/shutdown -p -h now")
  rescue IOError
    # Do nothing, because it probably means the machine shut down
    # and SSH connection was lost.
  end
end