* luci/contrib: olsrd-luci: only write sections for existing plugins, change default...
[project/luci.git] / contrib / package / olsrd-luci / files / lib / config / olsr.lua
index d444e4d7c6f6b03c2e8a10d746e733a7a677ebba..a10837ff46ccc68b640f7203016800c25470fc8f 100644 (file)
@@ -15,6 +15,7 @@ $Id$
 
 ]]--
 
+require("luci.fs")
 require("luci.util")
 require("luci.model.uci")
 
@@ -57,7 +58,7 @@ local function _section(sect,sval,parstr)
 
        if sval then
                rv = rv .. "}\n"
-       end     
+       end
 
        return rv
 end
@@ -118,7 +119,9 @@ print( _section("general") )
 -- plugin config sections
 for k, v in luci.util.spairs(conf) do
        if conf[k][".type"] == "LoadPlugin" then
-               print( _section( k, "Library", "PlParam" ) )
+               if v.Library and luci.fs.access("/usr/lib/"..v.Library) then
+                       print( _section( k, "Library", "PlParam" ) )
+               end
        end
 end