2012-12-15 02:01:00 +00:00
|
|
|
#!/bin/sh
|
2016-01-01 21:18:47 +00:00
|
|
|
# Copyright (C) 2010-2015 OpenWrt.org
|
2012-12-15 02:01:00 +00:00
|
|
|
|
2013-04-03 10:01:07 +00:00
|
|
|
. /lib/functions/leds.sh
|
2016-01-01 21:18:30 +00:00
|
|
|
. /lib/functions/lantiq.sh
|
2012-12-15 02:01:00 +00:00
|
|
|
|
2016-01-01 21:18:47 +00:00
|
|
|
boot="$(lantiq_get_dt_led_chosen boot)"
|
|
|
|
failsafe="$(lantiq_get_dt_led_chosen failsafe)"
|
|
|
|
running="$(lantiq_get_dt_led_chosen running)"
|
2012-12-15 02:01:00 +00:00
|
|
|
|
2013-04-03 10:01:07 +00:00
|
|
|
set_state() {
|
2016-01-01 21:18:47 +00:00
|
|
|
status_led="$boot"
|
|
|
|
|
2012-12-15 02:01:00 +00:00
|
|
|
case "$1" in
|
|
|
|
preinit)
|
2016-01-01 21:18:47 +00:00
|
|
|
status_led_blink_preinit
|
2012-12-15 02:01:00 +00:00
|
|
|
;;
|
|
|
|
failsafe)
|
2016-01-01 21:18:47 +00:00
|
|
|
status_led_off
|
2016-06-19 14:33:44 +00:00
|
|
|
[ -n "$running" ] && {
|
|
|
|
status_led="$running"
|
|
|
|
status_led_off
|
|
|
|
}
|
2016-01-01 21:18:47 +00:00
|
|
|
status_led="$failsafe"
|
|
|
|
status_led_blink_failsafe
|
2015-12-17 09:27:52 +00:00
|
|
|
;;
|
|
|
|
preinit_regular)
|
2016-01-01 21:18:47 +00:00
|
|
|
status_led_blink_preinit_regular
|
2012-12-15 02:01:00 +00:00
|
|
|
;;
|
|
|
|
done)
|
2016-01-01 21:18:47 +00:00
|
|
|
status_led_off
|
2016-04-26 11:43:31 +00:00
|
|
|
[ -n "$running" ] && {
|
2016-01-01 21:18:47 +00:00
|
|
|
status_led="$running"
|
|
|
|
status_led_on
|
|
|
|
}
|
2012-12-15 02:01:00 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|