diff options
author | onefang | 2020-04-12 02:12:02 +1000 |
---|---|---|
committer | onefang | 2020-04-12 02:12:02 +1000 |
commit | 637ea1ad6fe668fc70c31de98fad03c9daca4b13 (patch) | |
tree | b06b30579b3500031bba099fc3d66d3839cd5f97 /src/tickle.lua | |
parent | Add the web host name to the config file. (diff) | |
download | opensim-SC-637ea1ad6fe668fc70c31de98fad03c9daca4b13.zip opensim-SC-637ea1ad6fe668fc70c31de98fad03c9daca4b13.tar.gz opensim-SC-637ea1ad6fe668fc70c31de98fad03c9daca4b13.tar.bz2 opensim-SC-637ea1ad6fe668fc70c31de98fad03c9daca4b13.tar.xz |
A small script to tickle the database.
Diffstat (limited to 'src/tickle.lua')
-rwxr-xr-x | src/tickle.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tickle.lua b/src/tickle.lua new file mode 100755 index 0000000..fc89237 --- /dev/null +++ b/src/tickle.lua | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/usr/bin/env luajit | ||
2 | |||
3 | -- Grab the stats web page, just to ping the database server, coz sledjchisl isn't event driven yet. | ||
4 | |||
5 | local paths = | ||
6 | { | ||
7 | ".sledjChisl.conf.lua", | ||
8 | "/etc/sledjChisl.conf.lua", | ||
9 | -- "/etc/sledjChisl.d/*.lua", | ||
10 | "~/.sledjChisl.conf.lua", | ||
11 | -- "~/.config/sledjChisl/*.lua", | ||
12 | } | ||
13 | |||
14 | local config = {} | ||
15 | |||
16 | for k, v in ipairs(paths) do | ||
17 | local cfg = loadfile(v) | ||
18 | if nil ~= cfg then | ||
19 | cfg = cfg() | ||
20 | for k, w in pairs(cfg) do | ||
21 | config[k] = w | ||
22 | end | ||
23 | end | ||
24 | end | ||
25 | |||
26 | os.execute("curl -so /dev/null http://" .. config.webHost .. "/" .. config.URL .. "/stats.html") | ||