summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-01-08 13:39:24 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-01-08 13:39:24 -0200
commit32380c6e7a0b04085adec8ebc037d6b8879d2c6e (patch)
tree1b640d24f3be3124e47f1c82eef5883c40116490
parentc7dfa44f1b1ae525d6b8cc8f792b1ca22370e1e0 (diff)
downloadkeyringer-32380c6e7a0b04085adec8ebc037d6b8879d2c6e.tar.gz
keyringer-32380c6e7a0b04085adec8ebc037d6b8879d2c6e.tar.bz2
Adding trap into genpair to make sure work folder is removed
-rwxr-xr-xshare/keyringer/genpair3
1 files changed, 3 insertions, 0 deletions
diff --git a/share/keyringer/genpair b/share/keyringer/genpair
index 7b79998..acd9efa 100755
--- a/share/keyringer/genpair
+++ b/share/keyringer/genpair
@@ -138,6 +138,8 @@ WORK="`mktemp -d $KEYDIR/genpair.XXXXXX`"
if [ "$?" != "0" ]; then
echo "Error setting up $WORK"
exit 1
+else
+ trap "rm -rf $WORK" EXIT
fi
# Dispatch
@@ -147,3 +149,4 @@ genpair_$KEYTYPE
# Cleanup
cd $CWD
rm -rf $WORK
+trap - EXIT