5 Dir.glob("/etc/postgresql/*/*/postgresql.conf").each do |conf|
6 cluster = conf.sub("/etc/postgresql/", "").sub("/postgresql.conf", "")
8 postgresql[:clusters] = Mash.new unless postgresql[:clusters]
9 postgresql[:clusters][cluster] = Mash.new unless postgresql[:clusters][cluster]
10 postgresql[:clusters][cluster][:version] = cluster.split("/").first.to_f
12 IO.foreach(conf) do |line|
13 if line =~ /^ *port *= *([0-9]+)\s+/
14 postgresql[:clusters][cluster][:port] = $1