From e74f1befb4c32c681b09768ed61196739babd44f Mon Sep 17 00:00:00 2001 From: Moritz Date: Mon, 10 Jan 2022 23:29:07 +0100 Subject: [PATCH] Added env variable to entrypoint --- files/entrypoint | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/files/entrypoint b/files/entrypoint index 9c3d6e3..4ed6206 100755 --- a/files/entrypoint +++ b/files/entrypoint @@ -52,6 +52,12 @@ if [ ! -f "$userConfFinalPath" ]; then echo "$user" >> "$userConfFinalPath" done fi + + if [ -n "$READONLY" ]; then + if [ "$READONLY" = "true" ]; then + sed 's/Subsystem sftp internal-sftp/Subsystem sftp internal-sftp -R/' "/etc/ssh/sshd_config" | tee "/etc/ssh/sshd_config" + fi + fi # Check that we have users in config if [ -f "$userConfFinalPath" ] && [ "$(wc -l < "$userConfFinalPath")" -gt 0 ]; then