From c8682aa9862b025e22ac1ed09969524ec5e5a1db Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sat, 15 Feb 2025 11:02:12 -0600 Subject: [PATCH] fix remove --- roles/usb_lib/files/usbmount/usbmount | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/usb_lib/files/usbmount/usbmount b/roles/usb_lib/files/usbmount/usbmount index f8984f2e8..bbbc9554f 100644 --- a/roles/usb_lib/files/usbmount/usbmount +++ b/roles/usb_lib/files/usbmount/usbmount @@ -209,10 +209,11 @@ elif [ "$1" = remove ]; then # A block or partition device has been removed. # Test if it is mounted. while read device mountpoint fstype remainder; do - if [ "$DEVNAME" = "$device" ]; then - # If the mountpoint and filesystem type are maintained by - # this script, unmount the filesystem. - if in_list "$mountpoint" "$MOUNTPOINTS" && + if [ "/$DEVNAME" = "$device" ]; then + log debug "umount device is $device" + # If the mountpoint and filesystem type are maintained by + # this script, unmount the filesystem. + if in_list "$mountpoint" "$MOUNTPOINTS" && in_list "$fstype" "$FILESYSTEMS"; then log info "executing command: umount -l $mountpoint" umount -l "$mountpoint"