diff --git a/plugins/guests/tinycore/cap/change_host_name.rb b/plugins/guests/tinycore/cap/change_host_name.rb new file mode 100644 index 000000000..2c16af362 --- /dev/null +++ b/plugins/guests/tinycore/cap/change_host_name.rb @@ -0,0 +1,14 @@ +module VagrantPlugins + module GuestTinyCore + module Cap + class ChangeHostName + def self.change_host_name(machine, name) + if !machine.communicate.test("hostname | grep '^#{name}$'") + machine.communicate.sudo("sh -c 'echo \"#{name}\" > /etc/hostname'") + machine.communicate.sudo("/usr/bin/sethostname #{name}") + end + end + end + end + end +end