From 4c485f18532068ba271ef4fa1a84bb465f1d9a29 Mon Sep 17 00:00:00 2001
From: Chris Lamb <lamby@debian.org>
Date: Sun, 19 Oct 2008 15:58:29 +0100
Subject: Add utility function to call 'Exit' when script exits.
---
functions/exit.sh | 6 ++++++
1 file changed, 6 insertions(+)
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
+}
--
cgit v1.0