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/usb-lock.sh unlock"
ACTION=="remove", SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="0781", ENV{ID_MODEL_ID}=="5567", RUN+="/usr/local/bin/usb-lock.sh lock"

you can use

sudo udevadm monitor 

for id USB see
https://wiki.archlinux.org/index.php/Udev

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