I need if USB device is plugged to not to continue the rest of the script
across multiple devices. I can't change every device and I am trying to
eliminate humans looking at which devices are plugged in.

I do conceded that many laptop cameras are USB and Bluetooth generally runs
on the USB bus.

I have yet to find a good answer to this myself.

On Fri, Jan 19, 2024, 3:54 PM Russell Senior <russ...@personaltelco.net>
wrote:

> Two things I will mention: lsusb and udev rules.
>
> I have a set of udev rules that match ttyusb devices by path (they don't
> implement serial numbers, which would be better) and give them a
> consistently named symlink. I use /dev/ttyRn, where n is a whole number.
> That means no matter what order they are enumerated in, I can find the
> device.
>
> I don't know if that helps with your problem or not, but I have found them
> to be useful in adjacent problems.
>
> --
> Russell
>
> On Fri, Jan 19, 2024, 15:17 Vince Winter <thine.technoc...@gmail.com>
> wrote:
>
> > Hello,
> >
> > I am trying to write a bash script to detect if USB device is plugged
> into
> > a device and post a message with a device name that is plugged to stdout.
> >
> > Complications are USB webcams, USB controllers, and this is going to be
> > used on large number of systems, so I can't customize to each system.
> >
>

Reply via email to