diff options
author | Thomas Preud'homme <thomas.preudhomme@linaro.org> | 2018-06-26 11:50:03 +0100 |
---|---|---|
committer | Thomas Preud'homme <thomas.preudhomme@linaro.org> | 2018-06-26 11:50:03 +0100 |
commit | acb17e8fc0736ce452d62abf73314a6621ad468c (patch) | |
tree | 24ded60aff6381a6e25a5e8161187e8a3e9d145a | |
parent | f1b899e227d583a0f62ee7cbb979c3ebd9efda92 (diff) |
tcwg-dev: Fix hostname of dev container in message
The note at the end of the start.sh script prints the value of the
hostname variable which is never set in the script. Calling the hostname
command is not an option because it prints the info for localhost.
The approach chosen assumes the machine is always reached via ssh when
running this script, in which case it can rely on SSH_CONNECTION to be
set with the server IP. The format of this environment variable is
documented in ssh (1) manual.
Change-Id: I0cd6291792d528584280008dfcd3c6cad23ea619
-rwxr-xr-x | tcwg-base/tcwg-dev/start.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tcwg-base/tcwg-dev/start.sh b/tcwg-base/tcwg-dev/start.sh index 463df8bf..edcd8aca 100755 --- a/tcwg-base/tcwg-dev/start.sh +++ b/tcwg-base/tcwg-dev/start.sh @@ -108,6 +108,7 @@ caps="--cap-add=IPC_LOCK --cap-add=SYS_PTRACE" $DOCKER run --name=$name --hostname=$(hostname)-dev --restart=unless-stopped -dt -p 22 $mounts --memory=$memlimit --pids-limit=5000 $caps $image --user $user "$@" port=$($DOCKER port $name 22 | cut -d: -f 2) +hostname=$(echo ${SSH_CONNECTION} | { read client_ip client_port server_ip server_port; echo $server_ip; }) set +x cat <<EOF |