I´m having some trouble with my udev
rule. At the moment, I had my udev rule setup to execute a script whenever a Android phone is connected to any USB port on the computer. But I don´t want the script to be executed from every USB port. I just want that the script to be execute in example when the phone is connected to the 4th USB port and nothing should happen when it is connected to 1st, 2nd or 3rd USB port.
How can I achieve that and how can I determine the for example 4th USB Port?
I would highly appreciate your help.
My current udev rule:
KERNELS="1-2:1.1", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}!="1d6b", ATTRS{idVendor}!="203a", ATTRS{idVendor}=="****", ATTRS{idProduct}=="****", RUN+="/usr/local/bin/tmp.sh $attr{serial}"
KERNELS="1-2:1.1", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}!="1d6b", ATTRS{idVendor}!="203a", ATTRS{idVendor}=="****", ATTRS{idProduct}=="****", RUN+="/usr/local/bin/tmp.sh $attr{serial}"
. I have no clue how to determine the right USB port.lsusb
output when the phone is plugged on that port?