#!/usr/bin/env luajit

-- Grab the stats web page, just to ping the database server, coz sledjchisl isn't event driven yet.

local paths =
{
  ".sledjChisl.conf.lua",
  "/etc/sledjChisl.conf.lua",
--  "/etc/sledjChisl.d/*.lua",
  "~/.sledjChisl.conf.lua",
--  "~/.config/sledjChisl/*.lua",
}

local config = {}

for k, v in ipairs(paths) do
    local cfg = loadfile(v)
    if nil ~= cfg then
	cfg = cfg()
	for k, w in pairs(cfg) do
	    config[k] = w
	end
    end
end

os.execute("curl -so /dev/null http://" .. config.webHost ..  "/" .. config.URL .. "/stats.html")