You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
392 B
Bash
20 lines
392 B
Bash
#!/bin/sh
|
|
|
|
|
|
stdbuf -oL -- udevadm monitor --udev -p /sys/block/sda | while read -r -- STATE _ _ _ _
|
|
do
|
|
if [ "$STATE" = "DISK_MEDIA_CHANGE=1" ]
|
|
then
|
|
echo "change detected"
|
|
if udisksctl info -b /dev/sda | grep filesystem
|
|
then
|
|
echo "floppy in (fs detected)"
|
|
udisksctl mount --block-device /dev/sda --no-user-interaction
|
|
else
|
|
echo "floppy out (no fs detected)"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
|