Skip to content
Snippets Groups Projects
Unverified Commit 02f2d879 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: don't call 'ip' to check if an interface exists

parent c4613c4e
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ local util = require 'gluon.util'
local platform = require 'gluon.platform'
local site = require 'gluon.site_config'
local fs = require 'nixio.fs'
local uci = require('simple-uci').cursor()
......@@ -19,7 +20,7 @@ local function iface_exists(ifaces)
if not ifaces then return nil end
for iface in ifaces:gmatch('%S+') do
if util.exec('ip', 'link', 'show', 'dev', (iface:gsub('%..*$', ''))) == 0 then
if fs.access('/sys/class/net/' .. iface:gsub('%..*$', '')) then
return ifaces
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment