diff --git a/files/generic/luci b/files/generic/luci index 6ebb5e2..e0db6b9 100755 --- a/files/generic/luci +++ b/files/generic/luci @@ -664,6 +664,26 @@ const methods = { return { onlineusers: error() }; } } + }, + + getETHInfo: { + call: function() { + if (!access('/sbin/ethinfo')) + return {}; + + const fd = popen('/sbin/ethinfo'); + if (fd) { + let ethinfo = fd.read('all'); + if (!ethinfo) + ethinfo = '{}'; + ethinfo = json(ethinfo); + fd.close(); + + return { result: ethinfo }; + } else { + return { result: error() }; + } + } } }; diff --git a/files/generic/luci-mod-status-autocore.json b/files/generic/luci-mod-status-autocore.json index 8bd4b92..5c54213 100644 --- a/files/generic/luci-mod-status-autocore.json +++ b/files/generic/luci-mod-status-autocore.json @@ -3,7 +3,7 @@ "description": "Grant access to autocore", "read": { "ubus": { - "luci": [ "getCPUInfo", "getTempInfo", "getCPUBench", "getCPUUsage", "getOnlineUsers" ] + "luci": [ "getCPUInfo", "getTempInfo", "getCPUBench", "getCPUUsage", "getOnlineUsers", "getETHInfo" ] } } }