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

25 lines
357 B
Bash
Raw Normal View History

2012-12-15 02:01:00 +00:00
#!/bin/sh
# Copyright (C) 2012-2013 OpenWrt.org
2012-12-15 02:01:00 +00:00
. /lib/functions/leds.sh
2012-12-15 02:01:00 +00:00
status_led="power"
2012-12-15 02:01:00 +00:00
set_state() {
2012-12-15 02:01:00 +00:00
case "$1" in
preinit)
status_led_set_heartbeat
2012-12-15 02:01:00 +00:00
;;
failsafe)
[ -d /sys/class/leds/power1 ] && {
status_led_off
led_timer "power1" 100 100
} || status_led_set_timer 100 100
2012-12-15 02:01:00 +00:00
;;
done)
status_led_on
led_off "power1"
2012-12-15 02:01:00 +00:00
;;
esac
}