vagrant/plugins/hosts/gentoo/cap/nfs.rb

40 lines
961 B
Ruby
Raw Normal View History

2014-01-08 05:11:59 +00:00
require "vagrant/util/subprocess"
require "vagrant/util/which"
2014-01-08 05:11:59 +00:00
module VagrantPlugins
module HostGentoo
module Cap
class NFS
def self.nfs_check_command(env)
if Vagrant::Util::Platform.systemd?
"#{systemctl_path} status --no-pager nfs-server.service"
2014-01-08 05:11:59 +00:00
else
"/etc/init.d/nfs status"
2014-01-08 05:11:59 +00:00
end
end
def self.nfs_start_command(env)
if Vagrant::Util::Platform.systemd?
"#{systemctl_path} start rpcbind nfs-server.service"
2014-01-08 05:11:59 +00:00
else
"/etc/init.d/nfs restart"
2014-01-08 05:11:59 +00:00
end
end
protected
def self.systemctl_path
path = Vagrant::Util::Which.which("systemctl")
return path if path
folders = ["/usr/bin", "/usr/sbin"]
folders.each do |folder|
path = "#{folder}/systemctl"
return path if File.file?(path)
end
end
2014-01-08 05:11:59 +00:00
end
end
end
end