From a50275c5dd2e1647c65d385134d359932a0384f9 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 26 Jan 2015 22:23:24 +0100 Subject: chroot-installation: handle failures properly --- bin/chroot-installation.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bin/chroot-installation.sh') diff --git a/bin/chroot-installation.sh b/bin/chroot-installation.sh index eff64ced..b1daa4e7 100755 --- a/bin/chroot-installation.sh +++ b/bin/chroot-installation.sh @@ -3,7 +3,7 @@ # Copyright 2012-2015 Holger Levsen # released under the GPLv=2 -DEBUG=false +DEBUG=true . /srv/jenkins/bin/common-functions.sh common_init "$@" @@ -38,6 +38,11 @@ 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 + exit 1 + fi } execute_ctmpfile() { @@ -245,6 +250,6 @@ if [ "$3" != "" ] ; then esac fi -cleanup_all trap - INT TERM EXIT +cleanup_all good -- cgit v1.2.3-54-g00ecf