I am trying to write a udev rule for USB drive plugin. I want to first mount it to
/media and then run the script at
/usr/local/bin/script.sh. When I insert the USB, it doesn't even mount the device with this rule. However, If I manually type the part in RUN into terminal, It mounts and executes script.
The rule file says:
ACTION=="add", KERNEL=="sd[a-z]*", RUN+="/bin/mount -t auto /dev/%k /media/ && /usr/local/bin/script.sh"
Is this the right way to execute two commands in RUN section of the rule?