package/base-files: add support for the switch LED trigger
authorGabor Juhos <juhosg@openwrt.org>
Sat, 31 Dec 2011 15:02:35 +0000 (15:02 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sat, 31 Dec 2011 15:02:35 +0000 (15:02 +0000)
SVN-Revision: 29629

package/base-files/Makefile
package/base-files/files/etc/init.d/led

index 12ae50ba1731fea115a3441c8cee91bc1edfced7..241986cb1998cf91f2f2dfedb7a312dac634b12e 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=99
+PKG_RELEASE:=100
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
index c0e26a0b8bbafd48257bc9830abd0118619f031e..43964bf0bbe6f3f58d4928e91c5cdee3bfaefe79 100755 (executable)
@@ -60,6 +60,14 @@ load_led() {
                        [ -n "$port_state" ] && \
                                echo $port_state > /sys/class/leds/${sysfs}/port_state
                        ;;
+
+               switch[0-9]*)
+                       local port_mask
+
+                       config_get port_mask $1 port_mask
+                       [ -n "$port_mask" ] && \
+                               echo $port_mask > /sys/class/leds/${sysfs}/port_mask
+                       ;;
                esac
        }
 }