fix: dmesg_grep: avoid sigpipe on some systems (#519)

Use 'grep -m 1' (works under Linux, busybox, BSD) instead of piping to head -n1
This commit is contained in:
Stéphane Lesimple
2026-06-08 21:41:08 +02:00
parent 737cfe4a5f
commit cc159fe7fd
+1 -1
View File
@@ -9,7 +9,7 @@ dmesg_grep() {
# dmesg truncated
return 2
fi
ret_dmesg_grep_grepped=$(dmesg 2>/dev/null | grep -E "$1" | head -n1)
ret_dmesg_grep_grepped=$(dmesg 2>/dev/null | grep -m 1 -E "$1")
# not found:
[ -z "$ret_dmesg_grep_grepped" ] && return 1
# found, output is in $ret_dmesg_grep_grepped