2014-01-14 06:25:35 +00:00
|
|
|
module VagrantPlugins
|
2016-06-18 19:06:20 +00:00
|
|
|
module GuestBSD
|
2014-01-14 06:25:35 +00:00
|
|
|
module Cap
|
|
|
|
class Halt
|
|
|
|
def self.halt(machine)
|
|
|
|
begin
|
2016-06-23 01:31:57 +00:00
|
|
|
machine.communicate.sudo("/sbin/shutdown -p now", shell: "sh")
|
2014-01-14 06:25:35 +00:00
|
|
|
rescue IOError
|
|
|
|
# Do nothing, because it probably means the machine shut down
|
|
|
|
# and SSH connection was lost.
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|