From: Marco Zanon Date: Wed, 12 Sep 2012 13:43:19 +0000 (+0000) Subject: Switched to trap to delete the temporary directory when finished. X-Git-Tag: 0.5~5 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=284932e50eeadd7af2ba61598e10c118fdeb2130;p=single_click_remote_help Switched to trap to delete the temporary directory when finished. --- 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__