From 67d6c8fbc081c58d92d78908459552603bcf6880 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 14 Apr 2010 20:19:09 +0200 Subject: remove lock when script exits Signed-off-by: Florian Pritz Signed-off-by: Pierre Schmitz --- syncrepo | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/syncrepo b/syncrepo index 1803b8c..f8975ff 100755 --- a/syncrepo +++ b/syncrepo @@ -9,6 +9,7 @@ repos='core,extra,testing,community,community-testing' [ ! -d "${target}" ] && exit 1 [ -f "${lock}" ] && exit 1 touch "${lock}" +trap "rm -f '${lock}'" EXIT INT TERM rsync -rptlv --safe-links --delete --progress -h \ --include='*/' \ @@ -25,5 +26,3 @@ rsync -rptlv --safe-links --delete --progress -h \ --exclude='lastsync' \ ${source}/{${repos}} \ "${target}" - -rm -f "${lock}" -- cgit v1.2.3-24-g4f1b