vagrant/plugins/hosts/linux/cap/rdp.rb

24 lines
655 B
Ruby
Raw Normal View History

require "vagrant/util/which"
2014-05-21 02:55:36 +00:00
module VagrantPlugins
module HostLinux
module Cap
class RDP
def self.rdp_client(env, rdp_info)
if !Vagrant::Util::Which.which("rdesktop")
raise Vagrant::Errors::LinuxRDesktopNotFound
end
2014-05-21 02:55:36 +00:00
args = []
args << "-u" << rdp_info[:username]
args << "-p" << rdp_info[:password] if rdp_info[:password]
args += rdp_info[:extra_args] if rdp_info[:extra_args]
args << "#{rdp_info[:host]}:#{rdp_info[:port]}"
Vagrant::Util::Subprocess.execute("rdesktop", *args)
end
end
end
end
end