Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion elasticsearch-init/upload.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
# shellcheck shell=dash

TPL_DIR=/templates

Expand All @@ -19,7 +20,7 @@ fi
for template in $TPLS; do

echo "Handling template file $template"
tpl_name=`_get_tpl_name_from_file "$template"`
tpl_name=$(_get_tpl_name_from_file "$template")

curl -XPUT --retry 2 --retry-delay 2 "$ELASTICSEARCH_URI"/_template/"${tpl_name}" -d @$TPL_DIR/"$template"

Expand Down
2 changes: 1 addition & 1 deletion grafana/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

if [ -n $GF_DATABASE_PORT ]; then
if [ -n "$GF_DATABASE_PORT" ]; then
export GF_DATABASE_HOST=$GF_DATABASE_HOST":"$GF_DATABASE_PORT
fi

Expand Down
5 changes: 2 additions & 3 deletions influxdb-init/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ delay=5s
echo "Waiting for influx to become available..."
success=1
for i in $(seq 1 $attempts); do
http get "${INFLUXDB_URL}/ping"
if [ $? -eq 0 ]; then
if http get "${INFLUXDB_URL}/ping"; then
success=0
break
else
Expand All @@ -43,7 +42,7 @@ post () {
}

echo "Creating database \"${MONASCA_DATABASE}\"..."
if [ -z ${INFLUXDB_SHARD_DURATION} ]; then
if [ -z "${INFLUXDB_SHARD_DURATION}" ]; then
post "CREATE DATABASE \"${MONASCA_DATABASE}\" WITH DURATION ${INFLUXDB_DEFAULT_RETENTION} REPLICATION 1 NAME \"default_mon\""
else
post "CREATE DATABASE \"${MONASCA_DATABASE}\" WITH DURATION ${INFLUXDB_DEFAULT_RETENTION} REPLICATION 1 SHARD DURATION ${INFLUXDB_SHARD_DURATION} NAME \"default_mon\""
Expand Down
2 changes: 1 addition & 1 deletion kafka-init/wait-for.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ do
;;
--)
shift
CLI="$@"
CLI="$*"
break
;;
--help)
Expand Down
8 changes: 4 additions & 4 deletions kafka/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/ash
# shellcheck shell=dash

set -x

Expand All @@ -23,15 +24,14 @@ export AUTHORIZER_LOG_LEVEL=${AUTHORIZER_LOG_LEVEL:-"WARN"}
GC_LOG_ENABLED=${GC_LOG_ENABLED:-"False"}

first_zk=$(echo "$ZOOKEEPER_CONNECTION_STRING" | cut -d, -f1)
zk_host=$(echo "$first_zk" | cut -d\: -f1)
zk_port=$(echo "$first_zk" | cut -d\: -f2)
zk_host=$(echo "$first_zk" | cut -d ":" -f1)
zk_port=$(echo "$first_zk" | cut -d ":" -f2)

# wait for zookeeper to become available
if [ "$ZOOKEEPER_WAIT" = "true" ]; then
success="false"
for i in $(seq "$ZOOKEEPER_WAIT_RETRIES"); do
ok=$(echo ruok | nc "$zk_host" "$zk_port" -w "$ZOOKEEPER_WAIT_TIMEOUT")
if [ $? -eq 0 -a "$ok" = "imok" ]; then
if ok=$(echo ruok | nc "$zk_host" "$zk_port" -w "$ZOOKEEPER_WAIT_TIMEOUT") && [ "$ok" = "imok" ]; then
success="true"
break
else
Expand Down