From: Marco Zanon <info@marcozanon.com>
Date: Wed, 12 Sep 2012 13:43:19 +0000 (+0000)
Subject: Switched to trap to delete the temporary directory when finished.
X-Git-Tag: SVN-to-Git~6
X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=b6d6ad21a7163ac7967e3f57ebcc79e3c7d30954;p=single_click_remote_help

Switched to trap to delete the temporary directory when finished.
---

diff --git a/0.x/skeleton b/0.x/skeleton
index ee34b6a..81352ef 100644
--- a/0.x/skeleton
+++ b/0.x/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__