First of all, thanks for the answer.
I’ve followed the guide, but nothing changed. Probably I’m doing something wrong.
Here my steps:
osmc@osmc:~$ udevadm monitor --kernel --property --subsystem-match=usb
monitor will print the received events for:
KERNEL - the kernel uevent
KERNEL[195.302412] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3 (usb)
ACTION=add
BUSNUM=001
DEVNAME=/dev/bus/usb/001/006
DEVNUM=006
DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3
DEVTYPE=usb_device
MAJOR=189
MINOR=5
PRODUCT=1b1c/1a03/110
SEQNUM=1366
SUBSYSTEM=usb
TYPE=0/0/0
KERNEL[195.305545] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0 (usb)
ACTION=add
DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0
DEVTYPE=usb_interface
INTERFACE=8/6/80
MODALIAS=usb:v1B1Cp1A03d0110dc00dsc00dp00ic08isc06ip50in00
PRODUCT=1b1c/1a03/110
SEQNUM=1367
SUBSYSTEM=usb
TYPE=0/0/0
So I’ve changed my udev rules like this:
sudo nano /etc/udev/rules.d/50-autotransfer.rules
ACTION==“add”, SUBSYSTEM==“usb”, ENV{PRODUCT}==“1b1c/1a03/110”, RUN+=“/bin/su osmc --command=‘/home/osmc/autocopy.sh’”
Tried with this too:
ACTION==“add”, SUBSYSTEM==“usb”, ENV{PRODUCT}==“1b1c/1a03/110”, RUN+=“/home/osmc/autocopy.sh”
(I reboot everytime, to be sure udev daemon updates)
My script (for debug purpose):
/home/osmc/autocopy.sh
#!/bin/bash
vcgencmd display_power 0
echo “hello” > /home/osmc/hello.txt
(just to see if display goes off and hello.txt file is created)
Everytime I insert my pendrive, nothing happens. Only some bad words travel in my mind (I don’t want my son to hear).
So, please, any (other) help will be much appreciated.