[openwrt/openwrt] base-files: board_detect: Address shellcheck warnings

LEDE Commits lede-commits at lists.infradead.org
Tue Nov 25 12:53:44 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cac609aca8f309c6081f90d6d4475e57c738e315

commit cac609aca8f309c6081f90d6d4475e57c738e315
Author: Andreas Gnau <andreas.gnau at iopsys.eu>
AuthorDate: Wed Oct 8 23:09:26 2025 +0200

    base-files: board_detect: Address shellcheck warnings
    
     * SC2166 (warning): Prefer [ p ] && [ q ] as [ p -a q ] is not well
       defined.
     * SC2086 (info): Double quote to prevent globbing and word splitting.
     * SC2091 (warning): Remove surrounding $() to avoid executing output
       (or use eval if intentional).
    
    Signed-off-by: Andreas Gnau <andreas.gnau at iopsys.eu>
    Link: https://github.com/openwrt/openwrt/pull/20831
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/base-files/files/bin/board_detect | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/base-files/files/bin/board_detect b/package/base-files/files/bin/board_detect
index 94f45bec53..4c50a6057d 100755
--- a/package/base-files/files/bin/board_detect
+++ b/package/base-files/files/bin/board_detect
@@ -4,11 +4,11 @@ CFG=$1
 
 [ -n "$CFG" ] || CFG=/etc/board.json
 
-[ -d "/etc/board.d/" -a ! -s "$CFG" ] && {
+if [ -d "/etc/board.d/" ] && [ ! -s "$CFG" ]; then
 	for a in $(ls /etc/board.d/*); do
-		[ -s $a ] || continue;
-		$(. $a)
+		[ -s "$a" ] || continue
+		(. "$a")
 	done
-}
+fi
 
 [ -s "$CFG" ] || return 1




More information about the lede-commits mailing list