From b2dc743aa6f9250044a4eb152c57c812d76a4c54 Mon Sep 17 00:00:00 2001 From: Nicolas Viennot Date: Sun, 11 Aug 2019 00:54:56 -0400 Subject: [PATCH] Allow hostname detection in docker --- docker-entrypoint.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index c91b1c13..0d34ab2d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -2,7 +2,11 @@ set -e if [ "${USE_PROXY}" == "1" ]; then - exec tmate-ssh-server -p 2200 -k ${SSH_KEYS_PATH} -h ${SSH_HOSTNAME} -x localhost -else - exec tmate-ssh-server -p 2200 -k ${SSH_KEYS_PATH} -h ${SSH_HOSTNAME} + set -- -x localhost "$@" fi + +if [ ! -z "${HOSTNAME}" ]; then + set -- -h "${HOSTNAME}" "$@" +fi + +exec tmate-ssh-server -p 2200 -k ${SSH_KEYS_PATH} "$@"