goodbye groups, come back return statements

This commit is contained in:
Spencer Alger
2014-01-15 01:56:24 -07:00
parent 77998feb8c
commit 7b967617b5

View File

@ -39,6 +39,7 @@ function manage_es {
local PIDS="$ROOT/.snapshots/pids"
group "start:$DO es"
if [ ! -d "$PIDS" ]; then
call mkdir -p $PIDS
fi
@ -83,30 +84,32 @@ function manage_es {
if [ $RUNNING -eq 0 ]; then
echo "Already running $ES_VERSION"
return 1
else
echo "PID file was left behind by ES"
call rm $PIDFILE
fi
fi
./scripts/es.sh install $ES_BRANCH $ES_RELEASE
if [ ! -x "$ES_BIN" ]; then
echo "Unable to find elasticsearch executable"
elif [ ! -f $PIDFILE ]; then
./scripts/es.sh install $ES_BRANCH $ES_RELEASE
return 1
fi
local ES_OPTS="-p $PIDFILE -Des.network.host=localhost -Des.discovery.zen.ping.multicast.enabled=false -Des.discovery.zen.ping_timeout=1"
local ES_OPTS="-p $PIDFILE -Des.network.host=localhost -Des.discovery.zen.ping.multicast.enabled=false -Des.discovery.zen.ping_timeout=1"
if [ -n "$ES_NODE_NAME" ]; then
ES_OPTS="$ES_OPTS -Des.node.name=$ES_NODE_NAME"
fi
if [ -n "$ES_NODE_NAME" ]; then
ES_OPTS="$ES_OPTS -Des.node.name=$ES_NODE_NAME"
fi
if [ "$ES_BRANCH" = "0.90" ]; then
echo "Starting Elasticsearch $ES_VERSION"
call $ES_BIN $ES_OPTS
else
echo "Starting Elasticsearch $ES_VERSION as a deamon"
call $ES_BIN -d $ES_OPTS
fi
if [ "$ES_BRANCH" = "0.90" ]; then
echo "Starting Elasticsearch $ES_VERSION"
call $ES_BIN $ES_OPTS
else
echo "Starting Elasticsearch $ES_VERSION as a deamon"
call $ES_BIN -d $ES_OPTS
fi
;;
stop)
@ -118,14 +121,13 @@ function manage_es {
if [ $RUNNING -eq 0 ]; then
kill $PID
echo "Elasticsearch $ES_VERSION stopped"
else
echo "PID file was left behind by ES"
return 0
fi
rm $PIDFILE
else
echo "Elasticsearch $ES_VERSION is not running."
fi
echo "Elasticsearch $ES_VERSION is not running."
return 1
;;
esac
group "end:$DO es"