ath79: use board name in LED migrations

Several devices added to LED migration script will just have their
(old) board name converted to tp-link.

By using a variable for this, the amount of code in the migration
script can be reduced and the chance for typos is reduced.

This patch also introduces the marker for beginning of a pattern
"^" to the regex, so the match is more specific.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6b0eb84336)
openwrt-19.07
Adrian Schmutzler 2019-10-21 16:29:35 +02:00 committed by John Crispin
parent 77d8efe80e
commit 144379e149
1 changed files with 3 additions and 4 deletions

View File

@ -4,6 +4,7 @@
. /lib/functions/migrations.sh
board=$(board_name)
boardonly="${board##*,}"
case "$board" in
engenius,epg5000)
@ -12,11 +13,9 @@ engenius,epg5000)
tplink,archer-c7-v2)
migrate_leds ":blue:=:green:"
;;
tplink,archer-c7-v4)
migrate_leds "archer-c7-v4:=tp-link:"
;;
tplink,archer-c7-v4|\
tplink,archer-c7-v5)
migrate_leds "archer-c7-v5:=tp-link:"
migrate_leds "^$boardonly:=tp-link:"
;;
wd,mynet-n750)
migrate_leds "wd:=mynet-n750:"