You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ca...@apache.org on 2007/11/21 04:53:37 UTC

svn commit: r596931 - /maven/archiva/tools/trunk/maven-meeper/src/bin/synchronize.sh

Author: carlos
Date: Tue Nov 20 19:53:36 2007
New Revision: 596931

URL: http://svn.apache.org/viewvc?rev=596931&view=rev
Log:
Do a proper check for running scripts

Modified:
    maven/archiva/tools/trunk/maven-meeper/src/bin/synchronize.sh

Modified: maven/archiva/tools/trunk/maven-meeper/src/bin/synchronize.sh
URL: http://svn.apache.org/viewvc/maven/archiva/tools/trunk/maven-meeper/src/bin/synchronize.sh?rev=596931&r1=596930&r2=596931&view=diff
==============================================================================
--- maven/archiva/tools/trunk/maven-meeper/src/bin/synchronize.sh (original)
+++ maven/archiva/tools/trunk/maven-meeper/src/bin/synchronize.sh Tue Nov 20 19:53:36 2007
@@ -9,6 +9,11 @@
 # 6. Copy the mod_rewrite rules to the Maven 1.x repository @ Ibiblio
 # ------------------------------------------------------------------------
 
+# check if script is already running
+PID=$$
+RUNNING=`ps -ef | grep synchronize.sh | grep -v 'sh -c' | grep -v grep | grep -v $PID`
+
+
 dir=`pwd`
 syncProperties=$dir/synchronize.properties
 source $syncProperties
@@ -27,8 +32,7 @@
 echo "SYNC_REPORTS = $SYNC_REPORTS"
 echo "JAVA = $JAVA"
 
-PID=$$
-RUNNING=`ps -ef | grep synchronize.sh | grep -v 'sh -c' | grep -v grep | grep -v $PID`
+# exit if already running
 echo $RUNNING
 if [ ! -z "$RUNNING" ]; then
   date >> $SYNC_REPORTS/synchronize.log
@@ -36,6 +40,7 @@
   echo $RUNNING >> $SYNC_REPORTS/synchronize.log
   exit 1
 fi
+
 
 [ "$MODE" = "batch" ] && echo && echo "Press any key to continue, or hit ^C to quit." && echo