summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lamb <lamby@debian.org>2008-10-19 15:58:29 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:03:43 +0100
commit4c485f18532068ba271ef4fa1a84bb465f1d9a29 (patch)
tree76a2bd0890bfbb4d20b966a106544cd4b9acfe45
parent4f9797c893286c3c4de99bdb906e69a615d7467e (diff)
downloadlive-build-4c485f18532068ba271ef4fa1a84bb465f1d9a29.zip
live-build-4c485f18532068ba271ef4fa1a84bb465f1d9a29.tar.gz
Add utility function to call 'Exit' when script exits.
-rwxr-xr-xfunctions/exit.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/functions/exit.sh b/functions/exit.sh
index 1c24462..47b88a7 100755
--- a/functions/exit.sh
+++ b/functions/exit.sh
@@ -24,3 +24,9 @@ Exit ()
umount chroot/selinux > /dev/null 2>&1 || true
umount chroot/sys > /dev/null 2>&1 || true
}
+
+Setup_cleanup ()
+{
+ Echo_message "Setting up cleanup function"
+ trap 'Exit' INT TERM HUP EXIT
+}