aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tickle.lua
blob: fc892376670af21f97e12beb77145bbb635a3702 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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")