summaryrefslogtreecommitdiffstats
path: root/target/linux/au1000-2.6/base-files/default/etc/diag.sh
blob: d97461532abad6dc5f25105b66c7fcdb4b1ac8fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# Copyright (C) 2007 OpenWrt.org

set_led() {
	local led="$1"
	local state="$2"
	[ -d "/sys/class/leds/mtx1:$led" ] && echo "$state" > "/sys/class/leds/mtx1:$led/brightness"
}

set_state() {
	case "$1" in
		preinit)
			set_led green 0
			set_led red 1
		;;
		failsafe)
			set_led green 1
			set_led red 1
		;;
		done)
			set_led green 1
			set_led red 0
		;;
	esac
}