openwrtv4/target/linux/lantiq/base-files/etc/diag.sh

39 lines
655 B
Bash
Raw Normal View History

2012-12-15 02:01:00 +00:00
#!/bin/sh
# Copyright (C) 2010-2015 OpenWrt.org
2012-12-15 02:01:00 +00:00
. /lib/functions/leds.sh
. /lib/functions/lantiq.sh
2012-12-15 02:01:00 +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
set_state() {
status_led="$boot"
2012-12-15 02:01:00 +00:00
case "$1" in
preinit)
status_led_blink_preinit
2012-12-15 02:01:00 +00:00
;;
failsafe)
status_led_off
[ -n "$running" ] && {
status_led="$running"
status_led_off
}
status_led="$failsafe"
status_led_blink_failsafe
;;
preinit_regular)
status_led_blink_preinit_regular
2012-12-15 02:01:00 +00:00
;;
done)
status_led_off
[ -n "$running" ] && {
status_led="$running"
status_led_on
}
2012-12-15 02:01:00 +00:00
;;
esac
}