From 02f2d8796c70116b3a382ea0df243774708c7371 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 11 Apr 2017 02:01:21 +0200 Subject: [PATCH] gluon-core: don't call 'ip' to check if an interface exists --- package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces b/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces index ed819089..d1b6cee2 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces @@ -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