gluon-status-page: replace nixio with luaposix

This commit is contained in:
Matthias Schiffer 2018-07-13 20:06:18 +02:00
parent 5fc04fb34a
commit 90031ba97a
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
1 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<%-
local fs = require 'nixio.fs'
local ubus = require 'ubus'
local unistd = require 'posix.unistd'
local util = require 'gluon.util'
local translations = {}
@ -42,13 +42,13 @@
local function is_wireless(iface)
while true do
local pattern = '/sys/class/net/' .. iface .. '/lower_*'
local lower = fs.glob(pattern)()
local lower = util.glob(pattern)[1]
if not lower then break end
iface = lower:sub(pattern:len())
end
return fs.access('/sys/class/net/' .. iface .. '/wireless') ~= nil
return unistd.access('/sys/class/net/' .. iface .. '/wireless') ~= nil
end
local interfaces = get_interfaces()
@ -148,7 +148,7 @@
<%
for _, iface in ipairs(interfaces) do
local wireless = is_wireless(iface)
local address = fs.readfile('/sys/class/net/' .. iface .. '/address')
local address = util.readfile('/sys/class/net/' .. iface .. '/address')
if address then
%>
<h3><%| iface %></h3>