Author: heiko.braun(a)jboss.com
Date: 2007-06-01 06:58:04 -0400 (Fri, 01 Jun 2007)
New Revision: 3356
Modified:
trunk/build/hudson/jboss/bin/http-spider.sh
Log:
Rely on files instead of exit codes. Seems to interfere with hudson
Modified: trunk/build/hudson/jboss/bin/http-spider.sh
===================================================================
--- trunk/build/hudson/jboss/bin/http-spider.sh 2007-06-01 08:22:21 UTC (rev 3355)
+++ trunk/build/hudson/jboss/bin/http-spider.sh 2007-06-01 10:58:04 UTC (rev 3356)
@@ -10,32 +10,37 @@
#
# @author Heiko.Braun(a)jboss.com
#
-# $Id: $
+# $Revision: $
#
#############################################################
-TIMEOUT=2 # wget timeout in sec
-SLEEP_TIME=10 # the actual sleep time in between test
-NUM_RETRIES=12 # equals 120 seconds before exit
+TIMEOUT=10 # wget timeout in sec
+SLEEP_TIME=5 # the actual sleep time in between test
+NUM_RETRIES=2 # equals 120 seconds before exit
if [ "x$1" = "x" ]; then
- echo "Usage: http.sh <hostname:port>"
- exit 0
+ echo "Usage: http.sh <hostname:port>"
fi
+# cleanup
+rm ./spider.success 2&>1 /dev/null
+rm ./spider.failed 2&>1 /dev/null
+
COUNTER=0
while [ $COUNTER -lt $NUM_RETRIES ]; do
if wget --spider --timeout=$TIMEOUT --tries=1 $1 &> /dev/null; then
- echo "Try $COUNTER: '$1' is available"
+ touch ./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"
+ echo "Try $COUNTER: '$1' does not respond, wait another $SLEEP_TIME
seconds"
fi
sleep $SLEEP_TIME
let COUNTER=COUNTER+1
done
-echo "Unable to connect to $1, exiting..."
-exit 1
+touch ./spider.failed
+echo "Unable to connect to $1, exiting..." > spider.failed
+exit 0
Show replies by date