diff --git a/lib/util-iso-mount.sh b/lib/util-iso-mount.sh index 43b6ef8..cb357d1 100644 --- a/lib/util-iso-mount.sh +++ b/lib/util-iso-mount.sh @@ -66,8 +66,11 @@ umount_fs(){ info "overlayfs umount: [%s]" "${FS_ACTIVE_MOUNTS[@]}" info "proc mounts: [%s]" "$(cat /proc/mounts | awk '{print$2}' | sort -r)" info "proc mounts (overlay): [%s]" "$(grep overlay /proc/mounts | awk '{print$2}' | sort -r)" - #umount "${FS_ACTIVE_MOUNTS[@]}" - umount -l "$(grep overlay /proc/mounts | awk '{print$2}' | sort -r)" "$(grep rootfs /proc/mounts | awk '{print$2}' | sort -r)" + if [[ "$(grep rootfs ${FS_ACTIVE_MOUNTS[@]})" ]]; then + umount "${FS_ACTIVE_MOUNTS[@]}" + else + umount -l "$(grep overlay /proc/mounts | awk '{print$2}' | sort -r)" + fi unset FS_ACTIVE_MOUNTS rm -rf "${mnt_dir}/work" fi