Browse Source

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.
pull/255/head
Sam Tygier 2 years ago
committed by XECDesign
parent
commit
7068086c94
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      scripts/common

+ 1
- 1
scripts/common View File

@ -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

Loading…
Cancel
Save