summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--weblog-model.lua16
2 files changed, 14 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 3eb56a3..366a29e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
APP_NAME=weblog
PACKAGE=acf-$(APP_NAME)
-VERSION=0.4.1
+VERSION=0.4.2
APP_DIST=\
weblog* \
diff --git a/weblog-model.lua b/weblog-model.lua
index 6ebc766..ec4929e 100644
--- a/weblog-model.lua
+++ b/weblog-model.lua
@@ -604,11 +604,21 @@ local getlogfile = function(source, cookiesfile, logfile)
local filecontent
if source.method == "http" or source.method == "https" then
local cmd = "wget -O - --no-check-certificate --load-cookies "..cookiesfile.." --post-data 'name="..logfile.."' '"..source.method.."://"..source.source.."/cgi-bin/acf/alpine-baselayout/logfiles/download' 2>/dev/null"
+ if string.find(logfile, "%.gz$") then
+ cmd = cmd.." | gunzip -c"
+ end
local f = io.popen(cmd)
filecontent = f:read("*a")
f:close()
elseif source.method == "local" then
- filecontent = fs.read_file(logfile)
+ if string.find(logfile, "%.gz$") then
+ local cmd = "gunzip -c "..logfile
+ local f = io.popen(cmd)
+ filecontent = f:read("*a")
+ f:close()
+ else
+ filecontent = fs.read_file(logfile)
+ end
end
return filecontent
end
@@ -825,7 +835,7 @@ function importlogs()
if connecttosource(source, cookiesfile) then
local files = getlogcandidates(source, cookiesfile)
for j,file in ipairs(files) do
- if string.match(file, "dansguardian/access%.log%.") then
+ if string.match(file, "dansguardian/access%.log[%.%-]") then
count = count + 1
logme("Processing " .. file )
logme("Getting " .. file )
@@ -834,7 +844,7 @@ function importlogs()
importdglog(logentries, source.sourcename)
logme("Deleting " .. file )
deletelogfile(source, cookiesfile, file)
- elseif string.match(file, "squid/access%.log%.") then
+ elseif string.match(file, "squid/access%.log[%.%-]") then
count = count + 1
logme("Processing " .. file )
logme("Getting " .. file )