#!/bin/sh
#
# Called from udev
-# Attemp to mount any added block devices
-# and remove any removed devices
+#
+# Attempt to mount any added block devices and remove any removed devices.
#
MOUNT="/bin/mount"
if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
do
- $UMOUNT $mnt
+ # 20100306: Remove the mount point forcibly (Lazy) as the user has already removed the device by the
+ # DJWillis: time this fires so any handles are bad anyway. This should stop 'stale' folders being
+ # left around all the time.
+ $UMOUNT -l $mnt
done
# Remove empty directories from auto-mounter