plugins/nmount: report mountpoint only if mounting was successful

This commit is contained in:
8B411 2022-12-20 14:42:32 +02:00
parent ac29248dd1
commit 368d0ec9d7
No known key found for this signature in database
GPG Key ID: 48FD2BA7DBCBD45D
1 changed files with 4 additions and 3 deletions

View File

@ -41,9 +41,10 @@ while [ -n "$dev" ]; do
fi
fi
elif [ -b "/dev/$dev" ]; then
pmount "/dev/$dev"
sleep 1
echo "/dev/$dev mounted to $(lsblk -n "/dev/$dev" -o MOUNTPOINT | sed "/^$/d")."
if pmount "/dev/$dev"; then
sleep 1
echo "/dev/$dev mounted to $(lsblk -n "/dev/$dev" -o MOUNTPOINT | sed "/^$/d")."
fi
else
echo "/dev/$dev does not exist or is not a block device."
fi