2012-04-19 04:23:25 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestUbuntu
|
|
|
|
class Guest < VagrantPlugins::GuestDebian::Guest
|
2012-01-13 06:57:32 +00:00
|
|
|
def mount_shared_folder(name, guestpath, options)
|
|
|
|
# Mount it like normal
|
|
|
|
super
|
|
|
|
|
|
|
|
# Emit an upstart event if upstart is available
|
2012-02-11 18:36:27 +00:00
|
|
|
vm.channel.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}")
|
2012-01-13 06:57:32 +00:00
|
|
|
end
|
|
|
|
|
2011-03-01 07:38:30 +00:00
|
|
|
def change_host_name(name)
|
2012-01-07 04:03:56 +00:00
|
|
|
if !vm.channel.test("sudo hostname | grep '#{name}'")
|
|
|
|
vm.channel.sudo("sed -i 's/.*$/#{name}/' /etc/hostname")
|
|
|
|
vm.channel.sudo("sed -i 's@^\\(127[.]0[.]1[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
|
|
|
vm.channel.sudo("service hostname start")
|
2011-03-01 07:38:30 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|