forked from tutumcloud/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
25 lines (23 loc) · 1.03 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
set -e
if [ "${ELASTICSEARCH_USER}" == "**None**" ] && [ "${ELASTICSEARCH_PASS}" == "**None**" ]; then
echo "=> Starting Elasticsearch with no base auth ..."
echo "========================================================================"
echo "You can now connect to this Elasticsearch Server using:"
echo ""
echo " curl localhost:9200"
echo ""
echo "========================================================================"
exec /usr/share/elasticsearch/bin/elasticsearch -Des.http.port=9200
else
USER=${ELASTICSEARCH_USER:-admin}
echo "=> Starting Elasticsearch with basic auth ..."
echo ${ELASTICSEARCH_PASS} | htpasswd -i -c /htpasswd ${USER}
echo "========================================================================"
echo "You can now connect to this Elasticsearch Server using:"
echo ""
echo " curl ${USER}:${ELASTICSEARCH_PASS}@localhost:9200"
echo ""
echo "========================================================================"
exec supervisord -n
fi