#!/bin/bash # Wait for udev to pin C920 nodes after boot. Never fail the unit: # discovery can still run with whatever is present. set -u udevadm settle -t 20 || true udevadm trigger --subsystem-match=video4linux --action=add || true udevadm trigger --subsystem-match=sound --action=add || true for _ in $(seq 1 45); do n=$(ls -1 /dev/cam[0-9][0-9] 2>/dev/null | wc -l) if [ "$n" -ge 1 ]; then echo "wait-for-cameras: $n pinned /dev/camNN nodes" exit 0 fi sleep 1 done echo "wait-for-cameras: none yet; starting anyway" >&2 exit 0