base-files: board_detect: allow specifying the generated file
[openwrt/openwrt.git] / package / base-files / files / bin / board_detect
1 #!/bin/sh
2
3 CFG=$1
4
5 [ -n "$CFG" ] || CFG=/etc/board.json
6
7 [ -d "/etc/board.d/" -a ! -f "$CFG" ] && {
8 for a in `ls /etc/board.d/*`; do
9 [ -x $a ] || continue;
10 $(. $a)
11 done
12 }
13
14 [ -f "$CFG" ] || return 1