diff --git a/client/entrypoint.sh b/client/entrypoint.sh index 7a66498..91b8e89 100644 --- a/client/entrypoint.sh +++ b/client/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh log_with_timestamp() { - echo -e "$1" | awk '{ print strftime("[%Y-%m-%d %H:%M:%S%z]"), $0 }' + echo -e "$1" | awk '{ "date -Iseconds" | getline d; print d, $0 }' } # Ensure the script is not run by the "root" user. @@ -107,5 +107,5 @@ if [ -n "${SCHEDULE}" ]; then exec supercronic "${HOME}/crontab" else log_with_timestamp "Running $1..." - exec "$@" 2>&1 | awk '{ print strftime("[%Y-%m-%d %H:%M:%S%z]"), $0 }' + exec "$@" 2>&1 | awk '{ "date -Iseconds" | getline d; print d, $0 }' fi diff --git a/server/entrypoint.sh b/server/entrypoint.sh index 8be02b0..fc3d171 100644 --- a/server/entrypoint.sh +++ b/server/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh log_with_timestamp() { - echo -e "$1" | awk '{ print strftime("[%Y-%m-%d %H:%M:%S%z]"), $0 }' + echo -e "$1" | awk '{ "date -Iseconds" | getline d; print d, $0 }' } # Ensure the script is not run by the "root" user. @@ -101,4 +101,4 @@ AllowUsers sshuser ################################ # Start sshd # ################################ -exec /usr/sbin/sshd -D -e -f "${HOME}/sshd/sshd.conf" 2>&1 | awk '{ print strftime("[%Y-%m-%d %H:%M:%S%z]"), $0 }' +exec /usr/sbin/sshd -D -e -f "${HOME}/sshd/sshd.conf" 2>&1 | awk '{ "date -Iseconds" | getline d; print d, $0 }'