mirror of
https://github.com/jorgevasquezp/my_linux_prefs.git
synced 2026-08-16 23:16:31 +00:00
Started tracking my linux preferences.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
pathtoname() {
|
||||
udevadm info -p /sys/"$1" | awk -v FS== '/DEVNAME/ {print $2}'
|
||||
}
|
||||
|
||||
stdbuf -oL -- udevadm monitor --udev -s block | while read -r -- _ _ event devpath _; do
|
||||
if [ "$event" = add ]; then
|
||||
devname=$(pathtoname "$devpath")
|
||||
udisksctl mount --block-device "$devname" --no-user-interaction
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user