ramips: base-files: optimize etc/diag.sh and etc/board.d/01_leds scripts
authorJohn Crispin <john@openwrt.org>
Mon, 17 Aug 2015 06:24:47 +0000 (06:24 +0000)
committerJohn Crispin <john@openwrt.org>
Mon, 17 Aug 2015 06:24:47 +0000 (06:24 +0000)
commit1ecca44850c8831ea197ef8821b1494f0bbd3a1a
treed67d33b5b95617a3ceee3c843c6ece4f9b29aea8
parent2507f5752a479826afc0ea1054d801b017157109
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>
SVN-Revision: 46665
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/diag.sh