2007-05-06 08:58:04 +00:00
|
|
|
#!/bin/sh
|
2013-02-18 10:37:43 +00:00
|
|
|
# Copyright (C) 2007-2013 OpenWrt.org
|
2007-05-06 08:58:04 +00:00
|
|
|
|
2013-02-18 10:37:43 +00:00
|
|
|
. /lib/functions/leds.sh
|
|
|
|
|
|
|
|
get_status_led() {
|
|
|
|
[ -d "/sys/class/leds/status" ] && status_led="status"
|
|
|
|
[ -d "/sys/class/leds/power:green" ] && status_led="power:green"
|
|
|
|
}
|
|
|
|
|
2007-05-06 08:58:04 +00:00
|
|
|
set_state() {
|
2013-02-18 10:37:43 +00:00
|
|
|
get_status_led
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
preinit)
|
2017-03-09 14:03:18 +00:00
|
|
|
status_led_blink_preinit
|
2013-02-18 10:37:43 +00:00
|
|
|
;;
|
|
|
|
failsafe)
|
2017-03-09 14:03:18 +00:00
|
|
|
status_led_blink_failsafe
|
2013-02-18 10:37:43 +00:00
|
|
|
;;
|
2014-12-15 10:37:00 +00:00
|
|
|
preinit_regular)
|
|
|
|
status_led_blink_preinit_regular
|
|
|
|
;;
|
2013-02-18 10:37:43 +00:00
|
|
|
done)
|
2017-03-09 14:03:18 +00:00
|
|
|
status_led_on
|
|
|
|
|
2013-02-18 10:37:43 +00:00
|
|
|
[ "$status_led" = "power:green" ] && {
|
|
|
|
led_off "power:red"
|
|
|
|
}
|
|
|
|
;;
|
|
|
|
esac
|
2007-05-06 08:58:04 +00:00
|
|
|
}
|