From b35794808bd93a3489565c3b9886a7c995463623 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 24 Dec 2019 21:20:51 +1000 Subject: Everyone gets a car, er I mean linky! --- apt-panopticommon.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'apt-panopticommon.lua') 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 APT.logName = function(host, a2, a3) local name = host - if nil ~= a2 then name = name .. "_" .. a2 end - if nil ~= a3 then name = name .. "_" .. a3 end - return 'results/LOG_' .. name .. '.html' + if (nil ~= a2) and ('' ~= a2) then name = name .. "_" .. a2 end + if (nil ~= a3) and ('' ~= a3) then name = name .. "_" .. a3 end + name = 'LOG_' .. name .. '.html' + return {'results/' .. name, '' .. name:gsub("/", "_") .. ''} end APT.logOpen = function(host, a2, a3) - local name = APT.logName(host, a2, a3) + local name = APT.logName(host, a2, a3)[1] if APT.checkFile(name) then return false end APT.logFile, e = io.open(name, "a+") if nil == APT.logFile then C('opening log file (' .. name .. ') - ' .. e); return false end @@ -422,7 +423,7 @@ APT.testing = function(t, host) end APT.execute = function (s) - D(" executing
" .. s .. "
") + D(" executing -   " .. s .. "") --[[ Damn os.execute() Lua 5.1 says it returns "a status code, which is system-dependent" Lua 5.2 says it returns true/nil, "exit"/"signal", the status code. @@ -441,7 +442,7 @@ APT.execute = function (s) end APT.fork = function(s) - D(" forking
" .. s .. "
") + D(" forking -   " .. s .. "") os.execute(s .. " &") end -- cgit v1.1