From 79567a647b8540f4d8dc5b949baae2513c5f1275 Mon Sep 17 00:00:00 2001 From: mudler Date: Mon, 10 Oct 2016 16:44:34 +0200 Subject: [PATCH] sabayon-maint-helper: acquire lock before execution --- sabayon-maint-helper | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sabayon-maint-helper b/sabayon-maint-helper index 9ce98c6..47dc703 100755 --- a/sabayon-maint-helper +++ b/sabayon-maint-helper @@ -81,7 +81,13 @@ main() { [ -z "$@" ] && help_msg && exit 1 - parse_args "$@" + ( + echo "Acquiring lock" + flock -x -w 10 200 || ( echo "Failed acquiring lock in 10 seconds" && exit 1 ) + + parse_args "$@" + + ) 200>/var/lock/.repomaint }