admin-mini: Merge MAC-Address detection from admin-full
This commit is contained in:
parent
4f354ea95a
commit
e96f838644
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue