From fb28c4fe687548541240894332ea75b4c4820167 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 25 Jul 2011 17:19:08 +0200 Subject: Use trap to cleanup --- createlinks | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'createlinks') diff --git a/createlinks b/createlinks index defc0b8..fe1ff6f 100755 --- a/createlinks +++ b/createlinks @@ -9,6 +9,7 @@ tmp="$(mktemp -d)" [ -f "${lock}" ] && exit 1 touch "${lock}" +trap "rm -rf '${lock}' '${tmp}'" EXIT INT TERM renice +10 -p $$ > /dev/null @@ -63,6 +64,3 @@ for repo in ${repos[@]}; do fi done done - -rm -rf ${tmp} -rm -f "${lock}" -- cgit v1.2.3-24-g4f1b