aboutsummaryrefslogtreecommitdiff
path: root/kvmx-create
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-06-13 21:16:26 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-06-13 21:16:26 -0300
commit7991f82317685dca908f7a5e6c0a6482bf0b493f (patch)
treeda918edca8ec2fc91476c0b811d7d95fe3814b28 /kvmx-create
parentb131906cb5b03a5c230f6d12d7823ca95fe9891a (diff)
downloadkvmx-7991f82317685dca908f7a5e6c0a6482bf0b493f.tar.gz
kvmx-7991f82317685dca908f7a5e6c0a6482bf0b493f.tar.bz2
Better trap at kvmx-create
Diffstat (limited to 'kvmx-create')
-rwxr-xr-xkvmx-create2
1 files changed, 1 insertions, 1 deletions
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"