Use luci.fs.access instead of luci.fs.isfile where applicable
authorSteven Barth <steven@midlink.org>
Fri, 2 Jan 2009 21:33:10 +0000 (21:33 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 2 Jan 2009 21:33:10 +0000 (21:33 +0000)
21 files changed:
applications/luci-ddns/luasrc/controller/ddns.lua
applications/luci-hd_idle/luasrc/controller/hd_idle.lua
applications/luci-initmgr/luasrc/controller/init.lua
applications/luci-mmc_over_gpio/luasrc/controller/mmc_over_gpio.lua
applications/luci-ntpc/luasrc/controller/ntpc.lua
applications/luci-olsr/luasrc/controller/olsr.lua
applications/luci-p910nd/luasrc/controller/p910nd.lua
applications/luci-polipo/luasrc/controller/polipo.lua
applications/luci-qos/luasrc/controller/qos.lua
applications/luci-samba/luasrc/controller/samba.lua
applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
applications/luci-statistics/luasrc/view/admin_statistics/networkplugins.htm
applications/luci-statistics/luasrc/view/admin_statistics/outputplugins.htm
applications/luci-statistics/luasrc/view/admin_statistics/systemplugins.htm
applications/luci-tinyproxy/luasrc/controller/tinyproxy.lua
applications/luci-upnp/luasrc/controller/upnp.lua
applications/luci-ushare/luasrc/controller/ushare.lua
applications/luci-uvc_streamer/luasrc/controller/uvc_streamer.lua
modules/admin-full/luasrc/model/cbi/admin_index/luci.lua
modules/admin-mini/luasrc/model/cbi/mini/luci.lua
modules/freifunk/luasrc/controller/freifunk/freifunk.lua

index 0adc6ab..6adbbb0 100644 (file)
@@ -17,7 +17,7 @@ module("luci.controller.ddns", package.seeall)
 function index()
        require("luci.i18n")
        luci.i18n.loadc("ddns")
-       if not luci.fs.isfile("/etc/config/ddns") then
+       if not luci.fs.access("/etc/config/ddns") then
                return
        end
        
index 45d102c..5dfbe16 100644 (file)
@@ -18,7 +18,7 @@ module("luci.controller.hd_idle", package.seeall)
 function index()
        require("luci.i18n")
        luci.i18n.loadc("hd_idle")
-       if not luci.fs.isfile("/etc/config/hd-idle") then
+       if not luci.fs.access("/etc/config/hd-idle") then
                return
        end
 
index aecf6c1..fbbc727 100644 (file)
@@ -15,7 +15,7 @@ $Id$
 module("luci.controller.init", package.seeall)
 
 function index()
-       if not luci.fs.isfile("/etc/rc.common") then
+       if not luci.fs.access("/etc/rc.common") then
                return
        end
 
index ce244cb..7beaa14 100644 (file)
@@ -18,7 +18,7 @@ module("luci.controller.mmc_over_gpio", package.seeall)
 function index()
        require("luci.i18n")
        luci.i18n.loadc("mmc_over_gpio")
-       if not luci.fs.isfile("/etc/config/mmc_over_gpio") then
+       if not luci.fs.access("/etc/config/mmc_over_gpio") then
                return
        end
 
index 8fa690f..9290644 100644 (file)
@@ -17,7 +17,7 @@ module("luci.controller.ntpc", package.seeall)
 function index()
        require("luci.i18n")
        luci.i18n.loadc("ntpc")
-       if not luci.fs.isfile("/etc/config/ntpclient") then
+       if not luci.fs.access("/etc/config/ntpclient") then
                return
        end
        
index 766107e..652f6b9 100644 (file)
@@ -1,7 +1,7 @@
 module("luci.controller.olsr", package.seeall)
 
 function index()
-       if not luci.fs.isfile("/etc/config/olsrd") then
+       if not luci.fs.access("/etc/config/olsrd") then
                return
        end
 
index 8cc0e71..75b2693 100644 (file)
@@ -18,7 +18,7 @@ module("luci.controller.p910nd", package.seeall)
 function index()
        require("luci.i18n")
        luci.i18n.loadc("p910nd")
-       if not luci.fs.isfile("/etc/config/p910nd") then
+       if not luci.fs.access("/etc/config/p910nd") then
                return
        end
 
index c3965ee..949f80a 100644 (file)
@@ -14,7 +14,7 @@ $Id$
 module("luci.controller.polipo", package.seeall)
 
 function index()
-       if not luci.fs.isfile("/etc/config/polipo") then
+       if not luci.fs.access("/etc/config/polipo") then
                return
        end
        
index 5a9ef5e..970dd3d 100644 (file)
@@ -14,7 +14,7 @@ $Id$
 module("luci.controller.qos", package.seeall)
 
 function index()
-       if not luci.fs.isfile("/etc/config/qos") then
+       if not luci.fs.access("/etc/config/qos") then
                return
        end
        
index a698777..75cb65a 100644 (file)
@@ -15,7 +15,7 @@ $Id$
 module("luci.controller.samba", package.seeall)
 
 function index()
-       if not luci.fs.isfile("/etc/config/samba") then
+       if not luci.fs.access("/etc/config/samba") then
                return
        end
        require("luci.i18n")
index 0aa6636..940d226 100644 (file)
@@ -32,7 +32,7 @@ function index()
        -- override entry(): check for existance <plugin>.so where <plugin> is derived from the called path
        function _entry( path, ... )
                local file = path[5] or path[4]
-               if luci.fs.isfile( "/usr/lib/collectd/" .. file .. ".so" ) then
+               if luci.fs.access( "/usr/lib/collectd/" .. file .. ".so" ) then
                        entry( path, ... )
                end
        end
index e29d97c..54ba2b0 100644 (file)
@@ -22,7 +22,7 @@ about open tcp connections, interface traffic, iptables rules etc.%></p>
 <p><%:stat_networkplugins_installed Installed network plugins:%>
        <ul>
                <% for plugin, desc in pairs(plugins) do %>
-                       <% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
+                       <% if luci.fs.access("/usr/lib/collectd/" .. plugin .. ".so") then %>
                                <li><a href="<%=controller%>/admin/statistics/collectd/network/<%=plugin%>"><%=desc%></a></li>
                        <% end %>
                <% end %>
index d230109..e79e2f4 100644 (file)
@@ -23,7 +23,7 @@ and to transmit the data over the network to other collectd instances.%></p>
 <p><%:stat_outputplugins_installed Installed output plugins:%>
        <ul>
                <% for plugin, desc in pairs(plugins) do %>
-                       <% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
+                       <% if luci.fs.access("/usr/lib/collectd/" .. plugin .. ".so") then %>
                                <li><a href="<%=controller%>/admin/statistics/collectd/output/<%=plugin%>"><%=desc%></a></li>
                        <% end %>
                <% end %>
index bb63228..0c1b2b5 100644 (file)
@@ -19,7 +19,7 @@ $Id$
 <p><%:stat_systemplugins_desc System plugins collecting values about system state and ressource usage on the device.:%>
        <ul>
                <% for plugin, desc in pairs(plugins) do %>
-                       <% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
+                       <% if luci.fs.access("/usr/lib/collectd/" .. plugin .. ".so") then %>
                                <li><a href="<%=controller%>/admin/statistics/collectd/system/<%=plugin%>"><%=desc%></a></li>
                        <% end %>
                <% end %>
index 2ecfb93..fb8d9e2 100644 (file)
@@ -15,7 +15,7 @@ $Id$
 module("luci.controller.tinyproxy", package.seeall)
 
 function index()
-       if not luci.fs.isfile("/etc/config/tinyproxy") then
+       if not luci.fs.access("/etc/config/tinyproxy") then
                return
        end
        
index a7fd66f..c88abdd 100644 (file)
@@ -15,7 +15,7 @@ $Id$
 module("luci.controller.upnp", package.seeall)
 
 function index()
-       if not luci.fs.isfile("/etc/config/upnpd") then
+       if not luci.fs.access("/etc/config/upnpd") then
                return
        end
        
index 2fdea4e..958f247 100644 (file)
@@ -18,7 +18,7 @@ module("luci.controller.ushare", package.seeall)
 function index()
        require("luci.i18n")
        luci.i18n.loadc("ushare")
-       if not luci.fs.isfile("/etc/config/ushare") then
+       if not luci.fs.access("/etc/config/ushare") then
                return
        end
 
index 1766c2b..64491dc 100644 (file)
@@ -18,7 +18,7 @@ module("luci.controller.uvc_streamer", package.seeall)
 function index()
        require("luci.i18n")
        luci.i18n.loadc("uvc_streamer")
-       if not luci.fs.isfile("/etc/config/uvc-streamer") then
+       if not luci.fs.access("/etc/config/uvc-streamer") then
                return
        end
 
index 3de8710..9a0282f 100644 (file)
@@ -28,7 +28,7 @@ l = c:option(ListValue, "lang", translate("language"))
 
 local i18ndir = luci.i18n.i18ndir .. "default."
 for k, v in pairs(luci.config.languages) do
-       if k:sub(1, 1) ~= "." and luci.fs.isfile(i18ndir .. k:gsub("_", "-") .. ".lua") then
+       if k:sub(1, 1) ~= "." and luci.fs.access(i18ndir .. k:gsub("_", "-") .. ".lua") then
                l:value(k, v)
        end
 end
index f9365c9..819a9b6 100644 (file)
@@ -28,7 +28,7 @@ l = c:option(ListValue, "lang", translate("language"))
 
 local i18ndir = luci.i18n.i18ndir .. "default."
 for k, v in pairs(luci.config.languages) do
-       if k:sub(1, 1) ~= "." and luci.fs.isfile(i18ndir .. k:gsub("_", "-") .. ".lua") then
+       if k:sub(1, 1) ~= "." and luci.fs.access(i18ndir .. k:gsub("_", "-") .. ".lua") then
                l:value(k, v)
        end
 end
index 533211b..ff739fd 100644 (file)
@@ -52,7 +52,7 @@ function index()
 
        assign({"freifunk", "olsr"}, {"admin", "status", "olsr"}, "OLSR", 30)
 
-       if luci.fs.isfile("/etc/config/luci_statistics") then
+       if luci.fs.access("/etc/config/luci_statistics") then
                assign({"freifunk", "graph"}, {"admin", "statistics", "graph"}, i18n("stat_statistics", "Statistiken"), 40)
        end