Sha256: db0e9ad8b66e2a48971ac5868c39e46661b7c035f98a7acbc90922f83fc92b33

Contents?: true

Size: 530 Bytes

Versions: 1

Compression:

Stored size: 530 Bytes

Contents

module VagrantPlugins
  module GuestNetBSD
    module Cap
      class ChangeHostName
        def self.change_host_name(machine, name)
          if !machine.communicate.test("hostname -s | grep '^#{name}$'")
            machine.communicate.sudo(<<CMDS, {shell: "sh"})
set -e
sed -e 's/^hostname=.*$/hostname=#{name}/' /etc/rc.conf > /tmp/rc.conf.vagrant_changehostname_#{name}
mv /tmp/rc.conf.vagrant_changehostname_#{name} /etc/rc.conf
hostname #{name}
CMDS
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/bundler/gems/vagrant-c84e05fd063f/plugins/guests/netbsd/cap/change_host_name.rb