Running Scripts on drive insertion/mount #1078
Replies: 1 comment
-
Parsing the
after connecting a flash drive with 3 partitions and then you can get detailed information with
|
Beta Was this translation helpful? Give feedback.
-
Parsing the
after connecting a flash drive with 3 partitions and then you can get detailed information with
|
Beta Was this translation helpful? Give feedback.
-
I found udisksctl monitor in a recent project where I want to automate the running of scripts when specific usb sticks or memory cards are connected.
I want to be very sure it's the right one. checking:
serial number from the block device
UUID from the partition header
UUID from the filesystem
Volume Label from the filesystem
and perhaps presence of an identifying file in the filesystem
And only run the script if everything matches.
udisksctl monitor outputs multiple lines during one 'event' which makes it tricky to process in a bash read loop.
Is there a way to get one long line per event? Or Maybe invoke a script for each event, with each line's key-value pair as an environment variable, accessible to that script?
Beta Was this translation helpful? Give feedback.
All reactions