-
Notifications
You must be signed in to change notification settings - Fork 0
/
show-settings.lua
33 lines (30 loc) · 896 Bytes
/
show-settings.lua
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
27
28
29
30
31
32
33
local function script_path()
local str = debug.getinfo(2, "S").source:sub(2)
return str:match("(.*/)") or "."
end
local function pdnslog(msg, loglevel)
-- Stub function
print(msg)
end
g = {}
f = require('functions')
g.pdns_scripts_path = script_path()
g.options = require('defaults')
g.options_overrides = require('overrides-handler')
package.path = package.path .. ";"..g.pdns_scripts_path.."/?.lua"
if not g.options_overrides then
pdnslog("Could not import overrides correctly (or there are none).")
else
for k, v in pairs(g.options_overrides) do
if type(v) ~= 'table' then
pdnslog("Loaded Option (".. tostring(k) .."): "..tostring(v))
else
pdnslog("Loaded Option (".. tostring(k) .."): "..tostring(v))
for index, value in pairs(v) do
pdnslog(index, value)
end
end
g.options[k] = v
end
pdnslog("Loaded ".. f.table_len(g.options_overrides) .." overrides")
end