[PATCH 4/4] setup-hald.sh: cleanup after ourselves

Guillem Jover guillem.jover at nokia.com
Mon Nov 3 14:17:36 PST 2008


Remove the cruft we have left behind for testing.
---
 hald/setup-hald.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hald/setup-hald.sh b/hald/setup-hald.sh
index 9e4a399..5fd3d98 100644
--- a/hald/setup-hald.sh
+++ b/hald/setup-hald.sh
@@ -10,6 +10,13 @@ esac
 export HALD_RUNNER_PATH=`pwd`/$backend:`pwd`/$backend/probing:`pwd`/$backend/addons:`pwd`/.:`pwd`/../tools:`pwd`/../tools/$backend
 export PATH=`pwd`/../hald-runner:$PATH
 
+cleanup()
+{
+    [ -n "$HALD_TMPDIR" ] && rm -rf $HALD_TMPDIR
+}
+
+trap cleanup EXIT INT ABRT QUIT TERM
+
 HALD_TMPDIR=`mktemp -t -d run-hald-XXXXXXXXXX` || exit 1
 
 chmod 755 $HALD_TMPDIR
-- 
1.6.0.2



More information about the hal mailing list