mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit 04f391752428b75828ca6510bd5e56487e3fa7c5
parent fe763694bff7cfe1ff2b7593cd875907a73bf373
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Fri,  3 Jan 2020 18:42:57 +0100

cleanup lock even when crashing

Diffstat:
svn-poll-myrepos | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/svn-poll-myrepos b/svn-poll-myrepos @@ -12,13 +12,18 @@ LOCK="$LOCKDIR/svn-poll-myrepos" USERS="$HOME/config/private/svnrepos" lockfile -r 0 "$LOCK" || { echo "could not acquire lock"; exit 1; } +cleanupfun() { + rm -f "$LOCK" || true +} +trap cleanupfun ERR EXIT cd grep '^\[svn/' "$CONFIG" | tr -d '[]' | while read REPO; do URL=$(svn info "$REPO" | grep '^URL' | cut -d':' -f2- | tr -d ' ') USER=$(grep "^$URL" "$USERS" | cut -d' ' -f2) + echo "$URL" "$USER" $HOME/bin/svn-poll "$URL" "$USER" done -rm -f "$LOCK" +# cleanup by cleanupfun