Skip to content

Commit

Permalink
Merge pull request #107 from sonicwu:master
Browse files Browse the repository at this point in the history
Fix 'start.sh' waits indefinitely when specified the 'dubbo.protocol.host' parameter
  • Loading branch information
sonicwu authored and chickenlj committed Oct 23, 2017
1 parent dee60b2 commit 4e4dc4d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ CONF_DIR=$DEPLOY_DIR/conf

SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
SERVER_PROTOCOL=`sed '/dubbo.protocol.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
SERVER_HOST=`sed '/dubbo.protocol.host/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
SERVER_PORT=`sed '/dubbo.protocol.port/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
LOGS_FILE=`sed '/dubbo.log4j.file/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`

if [ -z "$SERVER_HOST" ]; then
SERVER_HOST=`127.0.0.1`
fi

if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
Expand Down Expand Up @@ -69,7 +74,7 @@ while [ $COUNT -lt 1 ]; do
sleep 1
if [ -n "$SERVER_PORT" ]; then
if [ "$SERVER_PROTOCOL" == "dubbo" ]; then
COUNT=`echo status | nc -i 1 127.0.0.1 $SERVER_PORT | grep -c OK`
COUNT=`echo status | nc -i 1 $SERVER_HOST $SERVER_PORT | grep -c OK`
else
COUNT=`netstat -an | grep $SERVER_PORT | wc -l`
fi
Expand Down

0 comments on commit 4e4dc4d

Please sign in to comment.