Sha256: a8916a15ab8c4d714f49481564cdadea3279c5f6df08d312923e9357c636e6ea

Contents?: true

Size: 430 Bytes

Versions: 1

Compression:

Stored size: 430 Bytes

Contents

module VagrantPlugins
  module GuestOpenBSD
    module Cap
      class ChangeHostName
        def self.change_host_name(machine, name)
          if !machine.communicate.test("[ `hostname -f` = #{name} ] || [ `hostname -s` = #{name} ]")
            machine.communicate.sudo("su -m root -c 'echo #{name} > /etc/myname'")
            machine.communicate.sudo("hostname #{name}")
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-guests-openbsd-0.0.3 lib/vagrant-guests-openbsd/cap/change_host_name.rb