Switched to trap to delete the temporary directory when finished.
authorMarco Zanon <info@marcozanon.com>
Wed, 12 Sep 2012 13:43:19 +0000 (13:43 +0000)
committerMarco Zanon <info@marcozanon.com>
Wed, 12 Sep 2012 13:43:19 +0000 (13:43 +0000)
skeleton

index ee34b6aea1b42bbc0699c41ddd22dd3fbbb57583..81352ef5dc0b06c3174da3b28f4156207407bbd1 100644 (file)
--- 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__