base-files: add support for the morse LED trigger
[openwrt/staging/yousong.git] / package / base-files / files / etc / init.d / led
index f3f3c3f8a7c99ac73f4e3368671f02f011970a03..729796bcc7b79fd35cc043b33e5c6265f4193d19 100755 (executable)
@@ -24,6 +24,8 @@ load_led() {
        config_get delayoff $1 delayoff
        config_get interval $1 interval "50"
        config_get port_state $1 port_state
+       config_get delay $1 delay "150"
+       config_get message $1 message ""
 
        if [ "$trigger" = "rssi" ]; then
                # handled by rssileds userspace process
@@ -66,6 +68,11 @@ load_led() {
                                echo $port_state > /sys/class/leds/${sysfs}/port_state
                        ;;
 
+               "morse")
+                       echo $message > /sys/class/leds/${sysfs}/message
+                       echo $delay > /sys/class/leds/${sysfs}/delay
+                       ;;
+
                switch[0-9]*)
                        local port_mask