2018-05-06 08:20:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. /lib/functions/leds.sh
|
|
|
|
|
2018-05-18 16:06:03 +00:00
|
|
|
status_led="$(get_dt_led status)"
|
|
|
|
|
2018-05-06 08:20:11 +00:00
|
|
|
get_status_led() {
|
|
|
|
local board=$(board_name)
|
2018-03-02 18:28:50 +00:00
|
|
|
local boardname="${board##*,}"
|
2018-05-06 08:20:11 +00:00
|
|
|
|
|
|
|
case $board in
|
2018-03-02 18:28:50 +00:00
|
|
|
"avm,fritz300e")
|
|
|
|
status_led="${boardname}:green:power"
|
|
|
|
;;
|
2018-06-05 14:56:48 +00:00
|
|
|
"embeddedwireless,dorin")
|
|
|
|
status_led="dorin:green:status"
|
|
|
|
;;
|
2018-05-06 08:20:11 +00:00
|
|
|
"glinet,ar150")
|
|
|
|
status_led="gl-ar150:orange:wlan"
|
|
|
|
;;
|
|
|
|
"tplink,tl-wr1043nd-v1")
|
|
|
|
status_led="tp-link:green:system"
|
|
|
|
;;
|
|
|
|
"ubnt,unifi")
|
|
|
|
status_led="ubnt:green:dome"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
set_state() {
|
2018-05-18 16:06:03 +00:00
|
|
|
[ -z "$status_led" ] && get_status_led
|
2018-05-06 08:20:11 +00:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
preinit)
|
|
|
|
status_led_blink_preinit
|
|
|
|
;;
|
|
|
|
failsafe)
|
|
|
|
status_led_blink_failsafe
|
|
|
|
;;
|
|
|
|
preinit_regular)
|
|
|
|
status_led_blink_preinit_regular
|
|
|
|
;;
|
|
|
|
done)
|
|
|
|
status_led_on
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|