fix: fix error causing cam list to fail

Signed-off-by: Stephan Wendel <me@stephanwe.de>
This commit is contained in:
Stephan Wendel 2023-04-17 18:45:44 +02:00
parent 2bbe265e83
commit e3bd2e2e57
No known key found for this signature in database
GPG Key ID: F465B83ACBA45639

View File

@ -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
}