udev-block-add-change: fix checking if partition is mounted
is_used() function should operate on its argument, not global $DEVNAME.
This commit is contained in:
parent
3422cffe0d
commit
e0acdee23c
@ -24,8 +24,9 @@ xs_remove() {
|
|||||||
|
|
||||||
is_used() {
|
is_used() {
|
||||||
local sys_devpath=$1
|
local sys_devpath=$1
|
||||||
|
local devname=$(grep ^DEVNAME= $sys_devpath/uevent | cut -f 2 -d =)
|
||||||
# mounted; or enabled swap
|
# 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
|
return 0
|
||||||
fi
|
fi
|
||||||
# part of other device-mapper
|
# part of other device-mapper
|
||||||
|
Loading…
Reference in New Issue
Block a user