admin-mini: Merge MAC-Address detection from admin-full
This commit is contained in:
parent
6785c3ed4b
commit
d87d01a24b
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"))
|
translate("network_interface_hwaddr"), translate("network_interface_hwaddr_desc"))
|
||||||
function hwaddr.cfgvalue(self, section)
|
function hwaddr.cfgvalue(self, section)
|
||||||
local ix = self.map:get(section, "ifname") or ""
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue