From 55eb82a3b7ce3293bb7b4bd67ad7eb4e0bf9263c Mon Sep 17 00:00:00 2001 From: kavaribes Date: Tue, 21 Jan 2025 19:11:22 +0200 Subject: [PATCH] trying to fix startup warnings --- bin/controller.ssh.entrypoint.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/controller.ssh.entrypoint.sh b/bin/controller.ssh.entrypoint.sh index 9bdf3c5f..53846fd1 100755 --- a/bin/controller.ssh.entrypoint.sh +++ b/bin/controller.ssh.entrypoint.sh @@ -7,10 +7,14 @@ export _SERVICE=${USER}; export CONNECTION_STRING=$(echo ${ENV_VARS} | cut -d ';' -f 1) export USER_LOGIN=$(echo ${ENV_VARS} | cut -d ';' -f 2) -echo "[$(date)] Have a session for [${USER_LOGIN}] : ${USER}, ${SSH_ORIGINAL_COMMAND}, ${SSH_CLIENT}, ${SSH_CONNECTION} and [${CONNECTION_STRING}] command." >> /var/log/sshd.log +if [ -z "${SSH_ORIGINAL_COMMAND}" ]; then + echo "[$(date)] SSH_ORIGINAL_COMMAND is empty. Have a session for [${USER_LOGIN}] : ${USER}, ${SSH_CLIENT}, ${SSH_CONNECTION} and [${CONNECTION_STRING}] command." >> /var/log/sshd.log +else + echo "[$(date)] Have a session for [${USER_LOGIN}] : ${USER}, ${SSH_ORIGINAL_COMMAND}, ${SSH_CLIENT}, ${SSH_CONNECTION} and [${CONNECTION_STRING}] command." >> /var/log/sshd.log +fi ## SFTP handling with Alpine-specific paths -if [[ ${SSH_ORIGINAL_COMMAND} == "internal-sftp" ]] || [[ ${SSH_ORIGINAL_COMMAND} == "/usr/lib/ssh/sftp-server" ]]; then +if [[ "${SSH_ORIGINAL_COMMAND}" == "internal-sftp" ]] || [[ "${SSH_ORIGINAL_COMMAND}" == "/usr/lib/ssh/sftp-server" ]]; then echo "[$(date)] SFTP connection attempt from [${SSH_CLIENT}] for user [${USER}] to pod [${CONNECTION_STRING}]" >> /var/log/sshd.log # Check container OS type for better error reporting