From e3bd2e2e57a4961a1af436bbeeed6c9aa901156b Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Mon, 17 Apr 2023 18:45:44 +0200 Subject: [PATCH] fix: fix error causing cam list to fail Signed-off-by: Stephan Wendel --- libs/hwhandler.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/hwhandler.sh b/libs/hwhandler.sh index 17a0850..543a6d4 100755 --- a/libs/hwhandler.sh +++ b/libs/hwhandler.sh @@ -60,9 +60,15 @@ list_cam_v4l2ctrls() { ## Determine connected libcamera (CSI) device detect_libcamera() { + local avail if [[ "$(is_raspberry_pi)" = "1" ]] && [[ -x "$(command -v libcamera-hello)" ]]; then - libcamera-hello --list-cameras | awk 'NR==1 {print $1}' | grep -c "Available" + avail="$(libcamera-hello --list-cameras | awk 'NR==1 {print $1}')" + if [[ "${avail}" = "Available" ]]; then + echo "1" + else + echo "0" + fi fi }