From 69cfcc1d308f3923e99cbe4ef7dc536f1d5943ed Mon Sep 17 00:00:00 2001 From: Yaw Anokwa Date: Mon, 18 Sep 2023 16:36:27 -0700 Subject: [PATCH] Add robustness, by only branching if file is empty --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 9b11b8e..3f8bca3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -43,7 +43,7 @@ if [ "${SMTPPORTOUT}" ]; then mv /etc/exim4/exim4.conf.temp /etc/exim4/exim4.conf.template fi -if [ "$KEY_PATH" ] && [ "$CERTIFICATE_PATH" ]; then +if [ -s "$KEY_PATH" ] && [ -s "$CERTIFICATE_PATH" ]; then echo "MAIN_TLS_ENABLE = yes" >> /etc/exim4/exim4.conf.localmacros cp "$KEY_PATH" /etc/exim4/exim.key cp "$CERTIFICATE_PATH" /etc/exim4/exim.crt @@ -58,7 +58,7 @@ else } >> /etc/exim4/exim4.conf.localmacros fi -if [ "$DKIM_KEY_PATH" ]; then +if [ -s "$DKIM_KEY_PATH" ]; then cp "$DKIM_KEY_PATH" /etc/exim4/dkim.key chown Debian-exim /etc/exim4/dkim.key chmod 640 /etc/exim4/dkim.key