udev-block-add-change: fix checking if partition is mounted

is_used() function should operate on its argument, not global $DEVNAME.
pull/8/head
Marek Marczykowski-Górecki 8 years ago
parent 3422cffe0d
commit e0acdee23c
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

@ -24,8 +24,9 @@ xs_remove() {
is_used() {
local sys_devpath=$1
local devname=$(grep ^DEVNAME= $sys_devpath/uevent | cut -f 2 -d =)
# mounted; or enabled swap
if lsblk -dnr -o MOUNTPOINT "$DEVNAME" | grep -q .; then
if lsblk -dnr -o MOUNTPOINT "/dev/$devname" | grep -q .; then
return 0
fi
# part of other device-mapper

Loading…
Cancel
Save