luci-mod-admin-full: no menu entry for leds if "/sys/class/leds" is empty
[project/luci.git] / modules / luci-mod-admin-full / luasrc / controller / admin / system.lua
index 51f9d9d..85bf3b6 100644 (file)
@@ -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