This commit is contained in:
bee0005
2016-08-25 10:22:51 +00:00
9 changed files with 120 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
class PeerController < ApplicationController
def index
@hosts = Array.new
if get_hosts.blank?
flash[:danger] = "Check Server"
else
@hosts = get_hosts
end
end
def get_hosts
file_str = `cat ` + @hostfile_path
hosts_str = file_str.split("hosts:")[1]
return hosts_str.split("\n")
end
@hostfile_path = "../../../configure.conf"
end