diff options
author | Lauri Hakkarainen <bionik@gmail.com> | 2018-02-27 11:30:57 +0300 |
---|---|---|
committer | Lauri Hakkarainen <bionik@gmail.com> | 2018-02-27 11:30:57 +0300 |
commit | a55b3a1c7a521490a48f605ec1e7ed8a17c6ed72 (patch) | |
tree | b1f286e6955b5016a8a06939500a7aed95156b90 | |
parent | 5cf9c68a1906c7c83293164d748b3281513e20bf (diff) |
Will now echo found devices only if trying to use an USB cam and if devices are found
-rwxr-xr-x | src/modules/octopi/filesystem/home/root/bin/webcamd | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/octopi/filesystem/home/root/bin/webcamd b/src/modules/octopi/filesystem/home/root/bin/webcamd index 3a7021b..08fd003 100755 --- a/src/modules/octopi/filesystem/home/root/bin/webcamd +++ b/src/modules/octopi/filesystem/home/root/bin/webcamd @@ -147,10 +147,12 @@ while true; do # get list of usb video devices into an array video_devices=($(find /dev -regextype sed -regex '\/dev/video[0-9]\+' | sort 2> /dev/null)) - echo "Found video devices:" && printf '%s\n' "${video_devices[@]}" if [ ${#video_devices[@]} != 0 ] && { [ "$camera" = "auto" ] || [ "$camera" = "usb" ] ; }; then + echo "Found video devices:" + printf '%s\n' "${video_devices[@]}" + if [[ $usb_device_path ]]; then # usb device is explicitly set in options if containsString "$usb_device_path" "${video_devices[@]}"; then |