svn commit: r631159 - /lenya/zone/bin/nightly-docu.sh

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Tue Feb 26 02:20:43 2008
New Revision: 631159

URL: http://svn.apache.org/viewvc?rev=631159&view=rev
Log:
Stop server only if PID file exists.

Modified:
    lenya/zone/bin/nightly-docu.sh

Modified: lenya/zone/bin/nightly-docu.sh
URL: http://svn.apache.org/viewvc/lenya/zone/bin/nightly-docu.sh?rev=631159&r1=631158&r2=631159&view=diff
==============================================================================
--- lenya/zone/bin/nightly-docu.sh (original)
+++ lenya/zone/bin/nightly-docu.sh Tue Feb 26 02:20:43 2008
@@ -22,9 +22,13 @@
 #first, kill running Lenya instance
 echo >> $logfile
 echo "#first, kill running lenya instance" >> $logfile 
-DOCU_PID=`cat /export/home/lenya/bin/lenya-docu.pid`
-ps -ef |grep lenya|grep $DOCU_PID|grep -v grep|awk '{print "kill -9 "$2}'|sh >> $logfile
-rm /export/home/lenya/bin/lenya-docu.pid  >> $logfile
+
+pid_file=/export/home/lenya/bin/lenya-docu.pid
+if test -f $pid_file
+  DOCU_PID=`cat /export/home/lenya/bin/lenya-docu.pid`
+  ps -ef |grep lenya|grep $DOCU_PID|grep -v grep|awk '{print "kill -9 "$2}'|sh >> $logfile
+  rm $pid_file  >> $logfile
+fi
 
 echo "#starting" >> $logfile 2>&1
 ./lenya.sh servlet >> $logfile 2>&1 &
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.