diff options
Diffstat (limited to '')
-rw-r--r-- | apt-panopticommon.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index 54e2be1..ea6346e 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua | |||
@@ -317,13 +317,14 @@ APT.html = false | |||
317 | 317 | ||
318 | APT.logName = function(host, a2, a3) | 318 | APT.logName = function(host, a2, a3) |
319 | local name = host | 319 | local name = host |
320 | if nil ~= a2 then name = name .. "_" .. a2 end | 320 | if (nil ~= a2) and ('' ~= a2) then name = name .. "_" .. a2 end |
321 | if nil ~= a3 then name = name .. "_" .. a3 end | 321 | if (nil ~= a3) and ('' ~= a3) then name = name .. "_" .. a3 end |
322 | return 'results/LOG_' .. name .. '.html' | 322 | name = 'LOG_' .. name .. '.html' |
323 | return {'results/' .. name, '<a href="' .. name:gsub("/", "_") .. '">' .. name:gsub("/", "_") .. '</a>'} | ||
323 | end | 324 | end |
324 | 325 | ||
325 | APT.logOpen = function(host, a2, a3) | 326 | APT.logOpen = function(host, a2, a3) |
326 | local name = APT.logName(host, a2, a3) | 327 | local name = APT.logName(host, a2, a3)[1] |
327 | if APT.checkFile(name) then return false end | 328 | if APT.checkFile(name) then return false end |
328 | APT.logFile, e = io.open(name, "a+") | 329 | APT.logFile, e = io.open(name, "a+") |
329 | if nil == APT.logFile then C('opening log file (' .. name .. ') - ' .. e); return false end | 330 | if nil == APT.logFile then C('opening log file (' .. name .. ') - ' .. e); return false end |
@@ -422,7 +423,7 @@ APT.testing = function(t, host) | |||
422 | end | 423 | end |
423 | 424 | ||
424 | APT.execute = function (s) | 425 | APT.execute = function (s) |
425 | D(" executing <pre><code>" .. s .. "</code></pre>") | 426 | D(" executing - <code>" .. s .. "</code>") |
426 | --[[ Damn os.execute() | 427 | --[[ Damn os.execute() |
427 | Lua 5.1 says it returns "a status code, which is system-dependent" | 428 | Lua 5.1 says it returns "a status code, which is system-dependent" |
428 | Lua 5.2 says it returns true/nil, "exit"/"signal", the status code. | 429 | Lua 5.2 says it returns true/nil, "exit"/"signal", the status code. |
@@ -441,7 +442,7 @@ APT.execute = function (s) | |||
441 | end | 442 | end |
442 | 443 | ||
443 | APT.fork = function(s) | 444 | APT.fork = function(s) |
444 | D(" forking <pre><code>" .. s .. "</code></pre>") | 445 | D(" forking - <code>" .. s .. "</code>") |
445 | os.execute(s .. " &") | 446 | os.execute(s .. " &") |
446 | end | 447 | end |
447 | 448 | ||