4 if [[ -z "$START_TIMEOUT" ]]; then
 
   8 start_timeout_exceeded=false
 
  11 while netstat -lnt | awk '$4 ~ /:'$KAFKA_PORT'$/ {exit 1}'; do
 
  12     echo "waiting for kafka to be ready"
 
  14     count=$(expr $count + $step)
 
  15     if [ $count -gt $START_TIMEOUT ]; then
 
  16         start_timeout_exceeded=true
 
  21 if $start_timeout_exceeded; then
 
  22     echo "Not able to auto-create topic (waited for $START_TIMEOUT sec)"
 
  26 if [[ -n $KAFKA_CREATE_TOPICS ]]; then
 
  27     IFS=','; for topicToCreate in $KAFKA_CREATE_TOPICS; do
 
  28         echo "creating topics: $topicToCreate" 
 
  29         IFS=':' read -a topicConfig <<< "$topicToCreate"
 
  30         JMX_PORT='' $KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper $KAFKA_ZOOKEEPER_CONNECT --replication-factor ${topicConfig[2]} --partition ${topicConfig[1]} --topic "${topicConfig[0]}"