From 0ab6a9228aefc20a826a91b251f1ee0ff0ed9037 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 14 Sep 2024 03:54:56 -0400 Subject: [PATCH] fix: convert underscore to dash in service host Refs #72 --- entrypoint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint b/entrypoint index 23fd536..d1761f0 100755 --- a/entrypoint +++ b/entrypoint @@ -5,7 +5,7 @@ if [ -n "$SERVICE_TYPE" ] && [ -n "$SERVICE_NAME" ]; then service_name=$(echo "$SERVICE_NAME" | tr .- _ | tr '[:lower:]' '[:upper:]') host_prefix="DOKKU_${service_type}_${service_name}_PORT_" if [ -z "$SERVICE_HOST" ] && [ -z "$SERVICE_HOST_ENV_VAR" ]; then - SERVICE_HOST="$(echo "dokku-${service_type}-${service_name}" | tr '[:upper:]' '[:lower:]')" + SERVICE_HOST="$(echo "dokku-${service_type}-${service_name}" | tr '[:upper:]' '[:lower:]' | tr _ -)" fi if [ -z "$SERVICE_PORT" ] && [ -z "$SERVICE_PORT_ENV_VAR" ]; then SERVICE_PORT=$(env | sort | grep "$host_prefix" | grep PORT= | head -n1 | cut -d= -f2)