Skip to content

Commit

Permalink
Add robustness, by only branching if file is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
yanokwa committed Sep 18, 2023
1 parent 3c6137a commit 69cfcc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 69cfcc1

Please sign in to comment.