Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
image/games/base/entrypoint: Move function _prepare_ssh_host_key near…
Browse files Browse the repository at this point in the history
… _prepare_ssh_server

Signed-off-by: Timo Reichl <[email protected]>
  • Loading branch information
Timo Reichl committed Sep 27, 2022
1 parent a300fa4 commit 03978d1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions image/games/base/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 03978d1

Please sign in to comment.