summaryrefslogtreecommitdiff
path: root/scripts/common
diff options
context:
space:
mode:
authorSam Tygier <samtygier@yahoo.co.uk>2019-02-16 12:15:25 +0000
committerXECDesign <XECDesign@users.noreply.github.com>2019-02-18 12:01:00 +0000
commit7068086c94a5c048aad19c412e31a3a56a5c8b78 (patch)
treec46fdb1a20cc3631d29e22bd4934c0b567f5bb41 /scripts/common
parent9d38bfac234b149a78b14b8cd10185f230f469ad (diff)
Make sure unmount_image finds stale loop devices
Fixes #257 #104 #193 Instead of searching by full path, which is prone to fail, read full list and grep on filename.
Diffstat (limited to 'scripts/common')
-rw-r--r--scripts/common2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/common b/scripts/common
index 9db903e..bb75a7e 100644
--- a/scripts/common
+++ b/scripts/common
@@ -57,7 +57,7 @@ unmount_image(){
sync
sleep 1
local LOOP_DEVICES
- LOOP_DEVICES=$(losetup -j "${1}" | cut -f1 -d':')
+ LOOP_DEVICES=$(losetup --list | grep "$(basename "${1}")" | cut -f1 -d' ')
for LOOP_DEV in ${LOOP_DEVICES}; do
if [ -n "${LOOP_DEV}" ]; then
local MOUNTED_DIR