base-files: also generate configs when current is empty (FS#193)
[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 ! -s "$CFG" ] && {
8 for a in `ls /etc/board.d/*`; do
9 [ -x $a ] || continue;
10 $(. $a)
11 done
12 }
13
14 [ -s "$CFG" ] || return 1