Merge pull request #4009 from calvinhp/fix/master/freebsd_rsync_install
guest/freebsd: update rsync install for FreeBSD 10
This commit is contained in:
commit
dffdf763a6
|
@ -3,8 +3,17 @@ module VagrantPlugins
|
||||||
module Cap
|
module Cap
|
||||||
class RSync
|
class RSync
|
||||||
def self.rsync_install(machine)
|
def self.rsync_install(machine)
|
||||||
|
version = nil
|
||||||
|
machine.communicate.execute("uname -r") do |type, result|
|
||||||
|
version = result.split('.')[0].to_i if type == :stdout
|
||||||
|
end
|
||||||
|
if version >= 10
|
||||||
|
pkg_cmd = "pkg install -y"
|
||||||
|
else
|
||||||
|
pkg_cmd = "pkg_add -r"
|
||||||
|
end
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
comm.sudo("pkg_add -r rsync")
|
comm.sudo(pkg_cmd+" rsync")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue