Skip to content

Commit

Permalink
Merge branch 'release/v0.1.5_3'
Browse files Browse the repository at this point in the history
  • Loading branch information
duydo committed Jul 27, 2017
2 parents b50167c + f592bb4 commit 50648fc
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions evm
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ _get_current_es_version() {
}

_get_current_es_pid() {
# ps -ef | grep -i [E]lasticsearch | awk '{print $2}'
if [[ -f "${PID_FILE}" ]]; then
cat "${PID_FILE}"
fi
ps -ef | grep -i [E]lasticsearch | awk '{print $2}'
# if [[ -f "${PID_FILE}" ]]; then
# cat "${PID_FILE}"
# fi
}

_check_curl_if_available(){
Expand Down Expand Up @@ -205,12 +205,11 @@ start_es() {
cmd="${cmd} ${cmd_opts}"
fi

echo "==> Starting Elasticsearch ${current_version}"

echo "==> Starting Elasticsearch ${current_version}, please wait..."
${cmd}

while true; do
if [[ -f "${PID_FILE}" ]]; then
# if [[ -f "${PID_FILE}" ]]; then
if nc -z -w300 0.0.0.0 9200 2>/dev/null; then
echo "Elasticsearch $(_get_current_es_version) has been started."
break;
fi
Expand All @@ -225,7 +224,7 @@ stop_es() {

echo "==> Stopping Elasticsearch"
kill -SIGTERM "${pid}" || _abort "Could not stop Elasticsearch."
echo "Elasticsearch $(_get_current_es_version) has been stopped."
echo "Elasticsearch has been stopped."
}


Expand Down

0 comments on commit 50648fc

Please sign in to comment.