Merge pull request #4469 from Gurpartap/tinycore-change_host_name-pr
change_host_name.rb for TinyCore Linux
This commit is contained in:
commit
26c468b5f9
|
@ -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
|
Loading…
Reference in New Issue