diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-01-28 13:34:30 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-01-28 13:34:30 +0100 |
commit | ef0ac3bc7edad0ccbf3e09b557e039bb1d43b2c4 (patch) | |
tree | 9f6fc6d357dd6a3d677c90089fdc8424e58c5941 /bin | |
parent | c47f2768304f62c32814d3908ddd43b7677664a9 (diff) | |
download | jenkins.debian.net-ef0ac3bc7edad0ccbf3e09b557e039bb1d43b2c4.tar.xz |
chroot-installation: try harder to exit correctly
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/chroot-installation.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/chroot-installation.sh b/bin/chroot-installation.sh index b1daa4e7..8b23ff6e 100755 --- a/bin/chroot-installation.sh +++ b/bin/chroot-installation.sh @@ -27,6 +27,7 @@ export CHROOT_TARGET=$(mktemp -d -p /chroots/ chroot-installation-$1.XXXXXXXXX) export TMPFILE=$(mktemp -u) export CTMPFILE=$CHROOT_TARGET/$TMPFILE export TMPLOG=$(mktemp) +SUCCESS=false cleanup_all() { echo "Doing cleanup now." @@ -38,9 +39,7 @@ cleanup_all() { sudo umount -l $CHROOT_TARGET/proc || fuser -mv $CHROOT_TARGET/proc sudo rm -rf --one-file-system $CHROOT_TARGET || fuser -mv $CHROOT_TARGET rm -f $TMPLOG - if [ "$1" = "good" ] ; then - exit 0 - else + if ! $SUCCESS ; then exit 1 fi } @@ -251,5 +250,6 @@ if [ "$3" != "" ] ; then fi trap - INT TERM EXIT -cleanup_all good +SUCCESS=true +cleanup_all |