Using USB flash drive serial number in udev

I would like to identify the usb device by it’s serial number instead but I can’t get it to work.

ACTION=="add", SUBSYSTEMS=="usb", ATTR{idVendor}=="0781", ATTR{idProduct}=="5567", RUN+="/usr/local/bin/ unlock"
ACTION=="remove", SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="0781", ENV{ID_MODEL_ID}=="5567", RUN+="/usr/local/bin/ lock"

you can use

sudo udevadm monitor 

for id USB see

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.