[jbpm-commits] JBoss JBPM SVN: r3773 - jbpm4/trunk/hudson/jboss/bin.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Feb 4 08:46:11 EST 2009
Author: heiko.braun at jboss.com
Date: 2009-02-04 08:46:11 -0500 (Wed, 04 Feb 2009)
New Revision: 3773
Modified:
jbpm4/trunk/hudson/jboss/bin/http-spider.sh
Log:
Better pre-requisite checking on wget
Modified: jbpm4/trunk/hudson/jboss/bin/http-spider.sh
===================================================================
--- jbpm4/trunk/hudson/jboss/bin/http-spider.sh 2009-02-04 12:49:32 UTC (rev 3772)
+++ jbpm4/trunk/hudson/jboss/bin/http-spider.sh 2009-02-04 13:46:11 UTC (rev 3773)
@@ -14,10 +14,12 @@
#
#############################################################
-TIMEOUT=2 # wget timeout in sec
-SLEEP_TIME=10 # the actual sleep time in between test
-NUM_RETRIES=18 # equals 180 seconds before exit
+TIMEOUT=2 # wget timeout in sec
+SLEEP_TIME=10 # the actual sleep time in between test
+NUM_RETRIES=18 # equals 180 seconds before exit
+WGET="/usr/bin/wget" # the default unix wget location
+
if [ "x$1" = "x" -o "x$2" = "x" ]; then
echo "Usage: http-spider.sh <hostname:port> <output_dir>"
fi
@@ -28,22 +30,25 @@
echo "Check HTTP connection on $1"
-which wget > /dev/null
-if [ $? -eq 0 ]; then
- COUNTER=0
- while [ $COUNTER -lt $NUM_RETRIES ]; do
- if wget --spider --timeout=$TIMEOUT --tries=1 $1 &> /dev/null; then
- touch $2/spider.success
- echo "Try $COUNTER: '$1' is available" > ./spider.success
- exit 0
- else
- echo "Try $COUNTER: '$1' does not respond, wait another $SLEEP_TIME seconds"
- fi
- sleep $SLEEP_TIME
- let COUNTER=COUNTER+1
- done
+if [ -b $WGET ]; then
+ COUNTER=0
+ while [ $COUNTER -lt $NUM_RETRIES ]; do
+ if wget --spider --timeout=$TIMEOUT --tries=1 $1 &> /dev/null; then
+ touch $2/spider.success
+ echo "Try $COUNTER: '$1' is available" > ./spider.success
+ exit 0
+ else
+ echo "Try $COUNTER: '$1' does not respond, wait another $SLEEP_TIME seconds"
+ fi
+ sleep $SLEEP_TIME
+ let COUNTER=COUNTER+1
+ done
+else
+ echo "$WGET can not be found, exiting"
+ exit 1
fi
+
touch $2/spider.failed
echo "Unable to connect to $1, exiting..." > spider.failed
exit 0
More information about the jbpm-commits
mailing list