From 284932e50eeadd7af2ba61598e10c118fdeb2130 Mon Sep 17 00:00:00 2001
From: Marco Zanon <info@marcozanon.com>
Date: Wed, 12 Sep 2012 13:43:19 +0000
Subject: [PATCH] Switched to trap to delete the temporary directory when
 finished.

---
 skeleton | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/skeleton b/skeleton
index ee34b6a..81352ef 100644
--- a/skeleton
+++ b/skeleton
@@ -81,6 +81,7 @@ if [ "0" -ne "$?" ]; then
   echo "Temporary directory not created, exiting."
   exit 3
 fi
+trap "rm -Rf $TEMPORARY_DIRECTORY" EXIT
 echo "Temporary directory created: $TEMPORARY_DIRECTORY."
 
 ## 5. Extract package files and make Vnc server binary executable.
@@ -116,9 +117,4 @@ if [ "0" -ne "$?" ]; then
 fi
 export LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH
 
-## 7. Remove temporary directory and terminate.
-rm -rf $TEMPORARY_DIRECTORY
-echo "Removed temporary directory."
-exit 0
-
 __BINARY_BELOW__
-- 
2.30.2