diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces b/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces index 1e101f70..d10d3cbe 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces @@ -11,9 +11,12 @@ end local platform = require 'gluon.platform' local site = require 'gluon.site' +local json = require 'jsonc' local uci = require('simple-uci').cursor() local unistd = require 'posix.unistd' +local board_data = json.load('/etc/board.json') +local network_data = (board_data or {}).network local function iface_exists(ifaces) if not ifaces then return nil end @@ -26,8 +29,8 @@ local function iface_exists(ifaces) end -local lan_ifname = iface_exists(uci:get('network', 'lan', 'ifname')) -local wan_ifname = iface_exists(uci:get('network', 'wan', 'ifname')) +local lan_ifname = iface_exists((network_data.lan or {}).ifname) +local wan_ifname = iface_exists((network_data.wan or {}).ifname) if platform.match('ar71xx', 'generic', { 'cpe210',