From d87d01a24bb5dba7755d054e400ea861ae95a96c Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 18 Sep 2008 14:51:04 +0000 Subject: [PATCH] admin-mini: Merge MAC-Address detection from admin-full --- modules/admin-mini/luasrc/model/cbi/mini/network.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/admin-mini/luasrc/model/cbi/mini/network.lua b/modules/admin-mini/luasrc/model/cbi/mini/network.lua index e4dd2caec..ccb5dac89 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/network.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/network.lua @@ -36,7 +36,9 @@ hwaddr = s:option(DummyValue, "_hwaddr", translate("network_interface_hwaddr"), translate("network_interface_hwaddr_desc")) function hwaddr.cfgvalue(self, section) local ix = self.map:get(section, "ifname") or "" - return luci.fs.readfile("/sys/class/net/" .. ix .. "/address") or "n/a" + return luci.fs.readfile("/sys/class/net/" .. ix .. "/address") + or luci.util.exec("ifconfig " .. ix):match(" ([A-F0-9:]+)%s*\n") + or "n/a" end -- 2.25.1