diff options
author | Florian Eckert <fe@dev.tdt.de> | 2017-06-04 18:49:27 +0200 |
---|---|---|
committer | Yousong Zhou <yszhou4tech@gmail.com> | 2018-05-07 21:14:48 +0800 |
commit | 690ae5c211a5c5481cf180d71fe960c3f04a5e7e (patch) | |
tree | d41802897b87ac56c549a335a4ad8e972d2a8f47 /modules/luci-mod-admin-full | |
parent | da4fab0462bef28f8a9b929efea2910023c92ec3 (diff) |
luci-mod-admin-full: no menu entry for leds if "/sys/class/leds" is empty
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'modules/luci-mod-admin-full')
-rw-r--r-- | modules/luci-mod-admin-full/luasrc/controller/admin/system.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua index 51f9d9d7b..85bf3b686 100644 --- a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua +++ b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua @@ -27,7 +27,8 @@ function index() entry({"admin", "system", "fstab", "swap"}, cbi("admin_system/fstab/swap"), nil).leaf = true end - if fs.access("/sys/class/leds") then + local nodes, number = nixio.fs.glob("/sys/class/leds/*") + if number > 0 then entry({"admin", "system", "leds"}, cbi("admin_system/leds"), _("<abbr title=\"Light Emitting Diode\">LED</abbr> Configuration"), 60) end |