diff --git a/start-kafka-manager.sh b/start-kafka-manager.sh index 92e9d47..9dae12f 100644 --- a/start-kafka-manager.sh +++ b/start-kafka-manager.sh @@ -1,6 +1,6 @@ #!/bin/sh -if [[ $KM_USERNAME != '' && $KM_PASSWORD != '' ]]; then +if [ "x$KM_USERNAME" != "x" ] && [ "x$KM_PASSWORD" != "x" ]; then sed -i.bak '/^basicAuthentication/d' /kafka-manager-${KM_VERSION}/conf/application.conf echo 'basicAuthentication.enabled=true' >> /kafka-manager-${KM_VERSION}/conf/application.conf echo "basicAuthentication.username=${KM_USERNAME}" >> /kafka-manager-${KM_VERSION}/conf/application.conf @@ -8,4 +8,4 @@ if [[ $KM_USERNAME != '' && $KM_PASSWORD != '' ]]; then echo 'basicAuthentication.realm="Kafka-Manager"' >> /kafka-manager-${KM_VERSION}/conf/application.conf fi -exec ./bin/kafka-manager -Dconfig.file=${KM_CONFIGFILE} "${KM_ARGS}" "${@}" \ No newline at end of file +exec ./bin/kafka-manager -Dconfig.file=${KM_CONFIGFILE} "${KM_ARGS}" "${@}"