9 echo "Usage: $1 <scratch dir>"
13 if [ -z "$scratch_dir" ]; then
14 print_usage
"$0" 'Scratch dir not given' >&2
18 cd "$scratch_dir/share" ||
exit 1
21 for mp
in "${mps[@]}"; do
23 printf "Unmounting %i/%i...\r" "$mp_i" "${#mps[@]}"
36 for img
in "${imgs[@]}"; do
38 printf "Detaching and deleting %i/%i...\r" "$img_i" "${#imgs[@]}"
40 dev
=$
(losetup
-j "$img" |
sed -e 's/:.*//')
41 sudo losetup
-d "$dev"