From 690ae5c211a5c5481cf180d71fe960c3f04a5e7e Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Sun, 4 Jun 2017 18:49:27 +0200 Subject: [PATCH] luci-mod-admin-full: no menu entry for leds if "/sys/class/leds" is empty Signed-off-by: Florian Eckert Signed-off-by: Yousong Zhou --- modules/luci-mod-admin-full/luasrc/controller/admin/system.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"), _("LED Configuration"), 60) end -- 2.25.1