Largely replace the Debian packaging with a new and much more up-to-date

Debhelper based version.
This commit is contained in:
Sven Geuer
2024-01-18 16:28:49 +00:00
committed by Simon Kelley
parent 34bbb7a1b8
commit cd93d15ab1
67 changed files with 1364 additions and 948 deletions

40
debian/tests/functions.d/log.lua vendored Normal file
View File

@@ -0,0 +1,40 @@
-- Lua script logging calls from dnsmasq
-- Open the log file in append mode
logfile = assert(io.open("/var/log/dnsmasq-lua.log", "a"))
-- Prepend date and time to a string and write the result to the log file
function __log(str)
logfile:write(os.date("!%FT%TZ ")..str.."\n")
end
-- flush the log file
function __flush_log()
logfile:flush()
end
-- Log a call to init()
function init()
__log("initialising")
__flush_log()
end
-- Log a call to shutdown()
function shutdown()
__log("shutting down")
__flush_log()
end
-- Log a call to lease() including all arguments
function lease(operation, params)
local lines = {}
__log(operation.." lease")
for key,value in pairs(params) do
table.insert(lines, key..": "..value)
end
table.sort(lines)
for index,line in ipairs(lines) do
__log("\t"..line)
end
__flush_log()
end