Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit da39980

Browse files
committed
Use KNOWN_HOSTS_PATH directly in host-scripts/expose_ports.sh
1 parent 203d3ae commit da39980

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

host-scripts/expose_ports.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ die () {
2020
[ -z "${1}" ] && die "Need at least 1 port number argument!"
2121
MYAPP_PORTS=$@
2222

23-
[ -z "${SSH_HOME}" ] && die "Need environment variable \$SSH_HOME set!"
2423
[ -z "${CONTAINER_IP}" ] && die "Need environment variable \$CONTAINER_IP set!"
2524
[ -z "${SSHD_PORT}" ] && die "Need environment variable \$SSHD_PORT set!"
25+
[ -z "${KNOWN_HOSTS_PATH}" ] && die "Need env var \$KNOWN_HOSTS_PATH set!"
2626
BASE_SSH_CMD="-p ${SSHD_PORT} -o StrictHostKeyChecking=no -N -fn application@${CONTAINER_IP}"
2727

2828
## convert space separated string into a bash array
@@ -33,6 +33,6 @@ declare -a MYAPP_PORTS=${MYAPP_PORTS}
3333
# then set them up in the background
3434
for i in "${MYAPP_PORTS[@]}"; do
3535
kill $(lsof -i tcp:${i} -F p | cut -b 2-) >/dev/null 2>&1 || true
36-
ssh-keygen -f "${SSH_HOME}/.ssh/known_hosts" -R [${CONTAINER_IP}]:${SSHD_PORT} >/dev/null 2>&1 || true
36+
ssh-keygen -f "${KNOWN_HOSTS_PATH}" -R [${CONTAINER_IP}]:${SSHD_PORT} >/dev/null 2>&1 || true
3737
ssh ${BASE_SSH_CMD} -R localhost:${i}:localhost:${i} &
3838
done

0 commit comments

Comments
 (0)