ramips: base-files: optimize etc/diag.sh and etc/board.d/01_leds scripts
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 17 Aug 2015 06:24:47 +0000 (06:24 +0000)
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 17 Aug 2015 06:24:47 +0000 (06:24 +0000)
commit3390cb5be276508174dfb858a4b7b497c3360b01
treed67d33b5b95617a3ceee3c843c6ece4f9b29aea8
parent46a8cc9b500c7ca48146ea22dba9831a4e93b700
ramips: base-files: optimize etc/diag.sh and etc/board.d/01_leds scripts

Instead of using board name provided explicitly as text in LED name, ex.:

[...]
mlwg2)
status_led="mlwg2:blue:system"
[...]

use $board variable, which allows to combine together multiple boards with same color and LED names, ex:

[...]
mlw221|\
mlwg2)
status_led="$board:blue:system"
[...]

The above approach allows to shrink size of code in base-files/etc/board.d/01_leds and base-files/etc/diag.sh scripts dramatically.
One thing to keep in mind here is that we assume to use proper and consistent LED naming scheme ("device:color:led-name").

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46665 3c298f89-4303-0410-b956-a3cf2f4a3e73
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/diag.sh