X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/e32107a7fe79ce34f3bdf860410a6d5455efdca7..2f1fc2f95f9688b5ddb0252228b969eb37c54031:/bin/weather-filter

diff --git a/bin/weather-filter b/bin/weather-filter
index 1fc798f..3acca7b 100755
--- a/bin/weather-filter
+++ b/bin/weather-filter
@@ -42,6 +42,10 @@ function filter_data(dataset,width)
     width = 7
   end  
 
+  if #dataset <= width then
+    return dataset
+  end  
+
   local result = {}
   
   local window_spread = math.floor(width/2)
@@ -171,7 +175,7 @@ local day = arg[3]
 
 local dbdriver = require "luasql.sqlite3"
 env = assert(dbdriver.sqlite3())
-con = assert(env:connect(logdb))
+con = assert(env:connect(logdb,'READONLY'))
 
 if command == "list" then