use basename for setting hostname
This commit is contained in:
parent
bcf3a4b3d1
commit
a139dd2b59
|
@ -8,8 +8,8 @@ module VagrantPlugins
|
|||
if !comm.test("hostname -f | grep '^#{name}$'", sudo: false)
|
||||
basename = name.split(".", 2)[0]
|
||||
comm.sudo <<-EOH.gsub(/^ {14}/, '')
|
||||
echo '#{name}' > /etc/HOSTNAME
|
||||
hostname '#{name}'
|
||||
echo '#{basename}' > /etc/HOSTNAME
|
||||
hostname '#{basename}'
|
||||
|
||||
# Prepend ourselves to /etc/hosts
|
||||
grep -w '#{name}' /etc/hosts || {
|
||||
|
|
Loading…
Reference in New Issue