This is an automated email from the ASF dual-hosted git repository. shaofengshi pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push: new d9b028b KYLIN-3756 Support check-port-availability script for mac os x d9b028b is described below commit d9b028b24a0ad9ca09d4d4f1f6ee4de1e59ccd6a Author: yanghua <yanghua1...@gmail.com> AuthorDate: Thu Mar 21 13:58:54 2019 +0800 KYLIN-3756 Support check-port-availability script for mac os x --- build/bin/check-port-availability.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/bin/check-port-availability.sh b/build/bin/check-port-availability.sh index 023fdef..e27b893 100644 --- a/build/bin/check-port-availability.sh +++ b/build/bin/check-port-availability.sh @@ -18,13 +18,17 @@ # source $(cd -P -- "$(dirname -- "$0")" && pwd -P)/header.sh - +source $(cd -P -- "$(dirname -- "$0")" && pwd -P)/util.sh # get port from configuraton kylin_port=`grep "<Connector port=" ${KYLIN_HOME}/tomcat/conf/server.xml |grep protocol=\"HTTP/1.1\" | cut -d '=' -f 2 | cut -d \" -f 2` # check the availability of the port -kylin_port_in_use=`netstat -tlpn | grep "\b${kylin_port}\b"` +if isMacosX; then + kylin_port_in_use=`lsof -nP -iTCP:"${kylin_port}" | grep LISTEN` +else + kylin_port_in_use=`netstat -tlpn | grep "\b${kylin_port}\b"` +fi # if not available, prompt error messeage [[ -z ${kylin_port_in_use} ]] || quit "ERROR: Port ${kylin_port} is in use, please check the availability of the port and re-start Kylin"