Quantcast
Viewing all articles
Browse latest Browse all 4899

Troubleshooting • Re: Udev rule not executed when USB-drive inserted

I tried on my RPi 5: it successfully run with "=="

The file in /tmp contains:

Code:

# cat /tmp/usb_handler.log Script usb_handler.sh is executed on 2024-05-16 13:39:48
For one or other reason it works this evening, but having another problem. when I run the following script myself, it works:

Code:

#!/bin/bash# Path to LOGfilelog_file="/tmp/usb_handler.log"# Message to writetarget_dir=$(sudo lsblk -no MOUNTPOINT /dev/sda1)# Write message to logfileecho "$target_dir" >> "$log_file"
gives me: target_dir= "USB_Drive 1 (the name of my USB drive)

but when the same script is executed by the UDEV rule, the target_dir is EMPTY ???

Statistics: Posted by BramWerbrouck — Thu May 16, 2024 6:44 pm



Viewing all articles
Browse latest Browse all 4899

Trending Articles