From a499bca87c1a85044d06dfecd0ad0928718658d8 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Mon, 7 Aug 2023 13:38:35 -0700 Subject: sign-sync-binpackages: make the lock safer Signed-off-by: Robin H. Johnson --- sign-sync-binpackages.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sign-sync-binpackages.sh b/sign-sync-binpackages.sh index cc1a957..862cea9 100755 --- a/sign-sync-binpackages.sh +++ b/sign-sync-binpackages.sh @@ -54,6 +54,8 @@ if [[ -f ${LOCKFILE} ]] ; then exit 112 fi touch ${LOCKFILE} || exit 110 +# ensure the lock is cleaned on exit +trap "rm -f ${LOCKFILE}" SIGINT SIGTERM # make sure we have an updated gpg-agent gpgconf --kill all @@ -122,8 +124,4 @@ for a in ${ARCHES}; do date -u > ${arch_binpackages}/.timestamp done - -# we're done so remove the "lockfile" -rm ${LOCKFILE} - # vim: et ts=2 sts=2 sw=2 -- cgit v1.2.3-65-gdbad