summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-olsr/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-07-19 00:24:58 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-07-19 00:24:58 +0000
commit8fcd841aa9af96c8a4a4d3c1a555d2d1ed42332c (patch)
treecf6466b373236442e63742cb4f73b22579940784 /applications/luci-olsr/luasrc
parent6abba6163290b58cd9ebae98d8459ac38ef52a4b (diff)
convert luci.fs users to nixio.fs api
Diffstat (limited to 'applications/luci-olsr/luasrc')
-rw-r--r--applications/luci-olsr/luasrc/controller/olsr.lua4
-rw-r--r--applications/luci-olsr/luasrc/model/cbi/olsr/olsrdplugins.lua13
2 files changed, 8 insertions, 9 deletions
diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua
index 652f6b9d2..837873adf 100644
--- a/applications/luci-olsr/luasrc/controller/olsr.lua
+++ b/applications/luci-olsr/luasrc/controller/olsr.lua
@@ -1,7 +1,7 @@
module("luci.controller.olsr", package.seeall)
function index()
- if not luci.fs.access("/etc/config/olsrd") then
+ if not nixio.fs.access("/etc/config/olsrd") then
return
end
@@ -182,7 +182,7 @@ function fetch_txtinfo(otable)
local rawdata = luci.sys.httpget("http://127.0.0.1:2006/"..otable)
if #rawdata == 0 then
- if luci.fs.access("/proc/net/ipv6_route", "r") then
+ if nixio.fs.access("/proc/net/ipv6_route", "r") then
rawdata = luci.sys.httpget("http://[::1]:2006/"..otable)
if #rawdata == 0 then
return nil
diff --git a/applications/luci-olsr/luasrc/model/cbi/olsr/olsrdplugins.lua b/applications/luci-olsr/luasrc/model/cbi/olsr/olsrdplugins.lua
index 03f18a818..f81a4a4b4 100644
--- a/applications/luci-olsr/luasrc/model/cbi/olsr/olsrdplugins.lua
+++ b/applications/luci-olsr/luasrc/model/cbi/olsr/olsrdplugins.lua
@@ -13,9 +13,8 @@ You may obtain a copy of the License at
$Id$
]]--
-require("luci.fs")
-require("luci.ip")
-
+local ip = require "luci.ip"
+local fs = require "nixio.fs"
if arg[1] then
mp = Map("olsrd", translate("olsrd_plugins", "OLSR - Plugins"))
@@ -44,7 +43,7 @@ if arg[1] then
local function Cidr2IpMask(val)
if val then
for i = 1, #val do
- local cidr = luci.ip.IPv4(val[i]) or luci.ip.IPv6(val[i])
+ local cidr = ip.IPv4(val[i]) or ip.IPv6(val[i])
if cidr then
val[i] = cidr:network():string() .. " " .. cidr:mask():string()
end
@@ -59,9 +58,9 @@ if arg[1] then
local ip, mask = val[i]:gmatch("([^%s]+)%s+([^%s]+)")()
local cidr
if ip and mask and ip:match(":") then
- cidr = luci.ip.IPv6(ip, mask)
+ cidr = ip.IPv6(ip, mask)
elseif ip and mask then
- cidr = luci.ip.IPv4(ip, mask)
+ cidr = ip.IPv4(ip, mask)
end
if cidr then
@@ -220,7 +219,7 @@ else
)
-- create a loadplugin section for each found plugin
- for k, v in pairs(luci.fs.dir("/usr/lib")) do
+ for v in fs.dir("/usr/lib") do
if v:sub(1, 6) == "olsrd_" then
if not plugins[v] then
mpi.uci:section(