From 03978d160a624060e96db13a3b129f9b621a8f0f Mon Sep 17 00:00:00 2001 From: Timo Reichl Date: Tue, 27 Sep 2022 20:32:14 +0200 Subject: [PATCH] image/games/base/entrypoint: Move function _prepare_ssh_host_key near _prepare_ssh_server Signed-off-by: Timo Reichl --- image/games/base/docker-entrypoint.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/image/games/base/docker-entrypoint.sh b/image/games/base/docker-entrypoint.sh index 47893e9..6e44ebe 100755 --- a/image/games/base/docker-entrypoint.sh +++ b/image/games/base/docker-entrypoint.sh @@ -3,17 +3,6 @@ # Set original entrypoint set -- tini -- start.sh ${@} -# Helper function to fix host keys should they not exist -_prepare_ssh_host_key() { - host_key_type="${1}" - host_key_path="/opt/ssh/ssh_host_${host_key_type}_key" - - if [[ ! -f ${host_key_path} ]]; then - rm -f "${host_key_path}*" - ssh-keygen -q -N "" -t ${host_key_type} -f ${host_key_path} - fi -} - # Helper function to set time zone _prepare_time_zone() { echo "Setting time zone to: ${TIME_ZONE}" @@ -52,6 +41,17 @@ _fix_tmux_session_dir_ownership() { chown -R steamcmd:steamcmd ${tmux_socket_dir} } +# Helper function to fix host keys should they not exist +_prepare_ssh_host_key() { + local host_key_type="${1}" + local host_key_path="/opt/ssh/ssh_host_${host_key_type}_key" + + if [[ ! -f ${host_key_path} ]]; then + rm -f "${host_key_path}*" + ssh-keygen -q -N "" -t ${host_key_type} -f ${host_key_path} + fi +} + # Helper function to prepare the SSH server _prepare_ssh_server() { _ssh_keys="${STEAMCMD_SSH_AUTHORIZED_KEYS}"