From 4f674e93b8079989a1f4f1e80f1ab5aca679ff3a Mon Sep 17 00:00:00 2001 From: Tomas M Date: Tue, 20 Nov 2012 17:53:00 -0600 Subject: [PATCH] properly unmount when not needed --- livekitlib | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/livekitlib b/livekitlib index 7c388b9..e15db7f 100644 --- a/livekitlib +++ b/livekitlib @@ -436,9 +436,10 @@ copy_to_ram() MDIR="$(mounted_dir "$1")" MDEV="$(mounted_device "$1")" + MDEV="$(losetup $MDEV 2>/dev/null | cut -d " " -f 3)" umount "$MDIR" 2>/dev/null - if [ -f "$MDEV" ]; then # iso was mounted here, try to unmount the FS it resides on too + if [ "$MDEV" ]; then # iso was mounted here, try to unmount the FS it resides on too MDEV="$(mounted_device "$MDEV")" umount "$MDEV" 2>/dev/null fi