avoid concurrent instances
authorthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Wed, 11 Jun 2008 06:36:09 +0000 (06:36 +0000)
committerthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Wed, 11 Jun 2008 06:36:09 +0000 (06:36 +0000)
scripts/all-modules.sh

index 644c5b0..9a8387f 100755 (executable)
@@ -6,6 +6,14 @@
 # /root/svn-build
 # /root/svn-build-4.2
 
+# avoid running several instances of this script
+# when the svn server has problems, this can very well last quite a while
+
+COMMAND=$(basename $0)
+running=$(pgrep $COMMAND 2> /dev/null)
+# bail out if another instance is already running
+[ -n "$running" ] && exit 1
+
 OUTPUT=/build/modules
 
 # usage: do_version dir name