Use luci.fs.access instead of luci.fs.isfile where applicable
This commit is contained in:
parent
8887bed8b6
commit
dc73daa720
21 changed files with 21 additions and 21 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue