LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   udev rules aimed for USB drives only (https://www.linuxquestions.org/questions/linux-newbie-8/udev-rules-aimed-for-usb-drives-only-868440/)

xerox 03-14-2011 05:47 AM

udev rules aimed for USB drives only
 
I have written a udev rule as follows:

Code:

RUN+=/.../.../example.sh
Whenever i plug in a USB drive, this rule is executed, however it is also done when i plug in a dongle for WiFi. How do i make this udev rule specific for USB drives only. In other words this script should be run for USB devices only.

ciotog 03-14-2011 11:30 PM

As part of the rule you might specify:
Code:

SUBSYSTEMS=="usb"
but the WiFi dongle is also a USB device, isn't it?

ciotog 03-14-2011 11:44 PM

This might help:
Code:

ATTRS{product}=="Mass Storage Device"
reported from udevinfo (or udevadm info).

So a rule might include this to match only Mass Storage Devices.

xerox 03-15-2011 11:40 PM

yea...dongle is also under usb subsystems...i will try and see...


All times are GMT -5. The time now is 03:21 PM.