#!/bin/sh

countdown=20

# Return immediately if the camera /dev files don't exist
if [ ! -e /dev/media0 ] || [ ! -e /dev/udmabuf ]; then
	exit 0
fi

# Wait for uaccess to making them user readable
while [ "$countdown" -gt 0 ]; do
	if [ -r /dev/media0 ] && [ -r /dev/udmabuf ]; then
		exit 0
	fi
	countdown=$((countdown-1))
	sleep 0.1
done
exit 1
