From: Silvio Rhatto Date: Thu, 14 Jun 2018 00:16:26 +0000 (-0300) Subject: Better trap at kvmx-create X-Git-Tag: 0.1.0~224 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=7991f82317685dca908f7a5e6c0a6482bf0b493f;p=kvmx.git Better trap at kvmx-create --- diff --git a/kvmx-create b/kvmx-create index 59e4117..eafd489 100755 --- a/kvmx-create +++ b/kvmx-create @@ -260,7 +260,7 @@ function kvmx_create_custom { kvmx_sudo_run mount ${device}${partition_prefix}2 $WORK/ # Trap $WORK umount - trap 'umount $WORK && rmdir $WORK' INT TERM + trap 'if [ -e "$WORK" ]; then umount $WORK && rmdir $WORK; fi' INT TERM # Non-interactive installation APT_INSTALL="kvmx_sudo_run chroot $WORK/ apt-get install -y"