diff --git a/nginx/entrypoint.sh b/nginx/entrypoint.sh index 2b5afa8e..216c41aa 100644 --- a/nginx/entrypoint.sh +++ b/nginx/entrypoint.sh @@ -60,16 +60,17 @@ if [ -n "${api_key}" -o -n "${amplify_imagename}" ]; then chown nginx ${nginx_status_conf} > /dev/null 2>&1 fi -if ! grep '^api_key.*=[ ]*[[:alnum:]].*' ${agent_conf_file} > /dev/null 2>&1; then - echo "no api_key found in ${agent_conf_file}! exiting." -fi +if ! grep '^api_key.*=[ ]*[[:alnum:]].*' ${agent_conf_file} > /dev/null 2>&1; +then + echo "no api_key found in ${agent_conf_file}! Skipping amplify agent." +else + echo "starting amplify-agent ..." + service amplify-agent start > /dev/null 2>&1 < /dev/null -echo "starting amplify-agent ..." -service amplify-agent start > /dev/null 2>&1 < /dev/null - -if [ $? != 0 ]; then - echo "couldn't start the agent, please check ${agent_log_file}" - exit 1 + if [ $? != 0 ]; then + echo "couldn't start the agent, please check ${agent_log_file}" + exit 1 + fi fi wait ${nginx_pid}