FLOPPY dev as var + better fs check

master
root 8 years ago
parent c9c6bf2506
commit a8934a7ffc

@ -1,15 +1,17 @@
#!/bin/sh #!/bin/sh
#
FLOPPY="/dev/sda"
stdbuf -oL -- udevadm monitor --udev -p /sys/block/sda | while read -r -- STATE _ _ _ _ stdbuf -oL -- udevadm monitor --udev -p ${FLOPPY} | while read -r -- STATE _ _ _ _
do do
if [ "$STATE" = "DISK_MEDIA_CHANGE=1" ] if [ "${STATE}" = "DISK_MEDIA_CHANGE=1" ]
then then
echo "change detected" echo "change detected"
if udisksctl info -b /dev/sda | grep filesystem if [ "$(udisksctl info -b ${FLOPPY} | grep filesystem)" ]
then then
echo "floppy in (fs detected)" echo "floppy in (fs detected)"
udisksctl mount --block-device /dev/sda --no-user-interaction udisksctl mount -b ${FLOPPY} --no-user-interaction
else else
echo "floppy out (no fs detected)" echo "floppy out (no fs detected)"
fi fi

Loading…
Cancel
Save