From a7af79ef6aa999481425a6ec58f8e75b55216760 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jun 2018 20:41:02 -0300 Subject: Trap for work dir umounting --- kvmx-create | 3 +++ 1 file changed, 3 insertions(+) (limited to 'kvmx-create') diff --git a/kvmx-create b/kvmx-create index ae42c39..0375cf6 100755 --- a/kvmx-create +++ b/kvmx-create @@ -259,6 +259,9 @@ function kvmx_create_custom { kvmx_sudo_run mkfs.ext4 ${device}${partition_prefix}2 kvmx_sudo_run mount ${device}${partition_prefix}2 $WORK/ + # Trap $WORK umount + trap 'umount $WORK && rmdir $WORK' INT TERM + # Non-interactive installation APT_INSTALL="kvmx_sudo_run chroot $WORK/ apt-get install -y" -- cgit v1.2.3