* luci-0.8: backport r3638-3641
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 29 Oct 2008 05:08:03 +0000 (05:08 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 29 Oct 2008 05:08:03 +0000 (05:08 +0000)
applications/luci-statistics/luasrc/statistics/datatree.lua
applications/luci-statistics/root/etc/init.d/luci_statistics
applications/luci-statistics/root/usr/bin/stat-genconfig
contrib/package/olsrd-luci/Makefile
contrib/package/olsrd-luci/files/etc/config/olsrd

index 637fcf466f97bee75f47c07d0ec320016b912784..6a6cbd0d58b9f09f1c8dfb933203c4e6bf60a215 100644 (file)
@@ -7,7 +7,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 
-        http://www.apache.org/licenses/LICENSE-2.0
+               http://www.apache.org/licenses/LICENSE-2.0
 
 $Id$
 
@@ -19,7 +19,7 @@ local util = require("luci.util")
 local sys  = require("luci.sys")
 local fs   = require("luci.fs")
 local uci  = require("luci.model.uci").cursor()
-local sections = uci:get_all( "luci_statistics" )
+local sections = uci:get_all("luci_statistics")
 
 
 Instance = util.class()
@@ -59,13 +59,25 @@ function Instance._notzero( self, table )
 end
 
 function Instance._scan( self )
-       local dir = fs.dir( self._libdir )
-       if not dir then
+       local dirs = fs.dir( self:_mkpath() )
+       if not dirs then
                return
        end
-       for i, plugin in ipairs( dir ) do
-               if plugin:match("%w+.so") then
-                       self._plugins[ plugin:gsub(".so", "") ] = { }
+
+--     for i, plugin in ipairs( dirs ) do
+--             if plugin:match("%w+.so") then
+--                     self._plugins[ plugin:gsub("%.so$", "") ] = { }
+--             end
+--     end
+
+       for _, dir in ipairs(dirs) do
+               if dir ~= "." and dir ~= ".." and
+                  fs.stat(self:_mkpath(dir)).type == "directory"
+               then
+                       local plugin = dir:gsub("%-.+$", "")
+                       if not self._plugins[plugin] then
+                               self._plugins[plugin] = { }
+                       end
                end
        end
 
index 55999a8f7fe64e446b643888bb631550e9f260ec..e4da1d5b1ace9aa1ff9cde377f00aac85333bf57 100755 (executable)
@@ -17,6 +17,9 @@ start() {
                imagepath="$(uci get luci_statistics.rrdtool.image_path)"
                ln -s ${imagepath:-/tmp/rrdimg}/ /www/rrdimg
        fi
+
+    ### flush LuCI index cache
+    test -f /var/luci-indexcache && rm /var/luci-indexcache
 }
 
 restart() {
index 7f0a05f5febdc8ae2c1bd22de7b6b3d5b05ed12c..e179cdb344bf707d563156e7413d413a33371842 100755 (executable)
@@ -9,7 +9,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 
-        http://www.apache.org/licenses/LICENSE-2.0
+               http://www.apache.org/licenses/LICENSE-2.0
 
 $Id$
 
@@ -94,11 +94,17 @@ function config_exec( c )
                for key, type in pairs({ Exec="collectd_exec_input", NotificationExec="collectd_exec_notify" }) do
                        if sections[s][".type"] == type then
 
-                               cmd   = sections[s].cmdline
-                               user  = sections[s].cmduser  or "nobody"
-                               group = sections[s].cmdgroup or "nogroup"
+                               cmd = sections[s].cmdline
 
-                               str = str .. "\t" .. key .. " " .. user .. ":" .. group .. ' "' .. cmd .. "\"\n"
+                               if cmd then
+                                       cmd   = cmd:gsub("^%s+", ""):gsub("%s+$", "")
+                                       user  = sections[s].cmduser  or "nobody"
+                                       group = sections[s].cmdgroup
+
+                                       str = str .. "\t" .. key .. ' "' ..
+                                               user .. ( group and ":" .. group or "" ) .. '" "' ..
+                                               cmd:gsub('%s+', '" "') .. '"\n'
+                               end
                        end
                end
        end
@@ -156,9 +162,9 @@ function config_network( c )
                                                str = str .. "\t" .. key .. " " .. host .. "\n"
                                        end
                                end
-                        end
-                end
-        end
+                                               end
+                               end
+               end
 
        return str .. _string( c["TimeToLive"], "TimeToLive" )
                   .. _string( c["CacheFlush"], "CacheFlush" )
index c437dceb741f4adfeb3fc98ddfc98f8ee59420eb..d6235987a227156a4c85a29535c36839bcbb921b 100644 (file)
@@ -11,13 +11,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_BASENAME:=olsrd
 PKG_NAME:=$(PKG_BASENAME)-luci
-PKG_VERSION:=0.5.6
-PKG_RELEASE:=4
+PKG_VERSION:=0.5.6-r2
+PKG_RELEASE:=7
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_BASENAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_BASENAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.olsr.org/releases/0.5
-PKG_MD5SUM:=918a4d43eebb6d62889ecedb941c2029
+PKG_MD5SUM:=64b439cde30f48764f02cdd8766aba40
 
 include $(INCLUDE_DIR)/package.mk
 
index 117a93e4b5f8fa67cbd6ca32ea1fe8b276bed8bd..2fa31ee57f5fa59f227a0ddc581b3e1636b1105c 100644 (file)
@@ -4,6 +4,7 @@ config 'olsrd'
        option 'LinkQualityAlgorithm' 'etx_ff'
 
 config 'Interface'
+       option 'ignore' '1'
        option 'interface' 'ff'
        option 'Ip4Broadcast' '255.255.255.255'