summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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