Sha256: 662757097c243c3d34a892be1d2b12a8a754ddca20daf048749a345510fb38b0

Contents?: true

Size: 422 Bytes

Versions: 7

Compression:

Stored size: 422 Bytes

Contents

module VagrantPlugins
  module GuestDarwin
    module Cap
      class ChangeHostName
        def self.change_host_name(machine, name)
          if !machine.communicate.test("hostname -f | grep '^#{name}$' || hostname -s | grep '^#{name}$'")
            machine.communicate.sudo("scutil --set HostName #{name}")
            machine.communicate.sudo("hostname #{name}")
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/plugins/guests/darwin/cap/change_host_name.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/plugins/guests/darwin/cap/change_host_name.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/plugins/guests/darwin/cap/change_host_name.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/plugins/guests/darwin/cap/change_host_name.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/bundler/gems/vagrant-1e28f1ac31e7/plugins/guests/darwin/cap/change_host_name.rb
tnargav-1.3.6 plugins/guests/darwin/cap/change_host_name.rb
tnargav-1.3.3 plugins/guests/darwin/cap/change_host_name.rb