feature(scripts): allow providing own config

This commit is contained in:
Asif Bacchus 2021-05-13 13:53:49 -06:00
parent 713c5fa2ad
commit 3f8ab5d378

View File

@ -8,6 +8,13 @@ convertCase () {
printf "%s" "$1" | tr "[:lower:]" "[:upper:]" printf "%s" "$1" | tr "[:lower:]" "[:upper:]"
} }
if [ -f "/etc/postfix/main.cf.override" ]; then
# use provided configuration file
printf "\nAppending provided MAIN configuration... "
cat /etc/postfix/main.cf.override >> /etc/postfix/main.cf
\rm -f /tmp/main.cf.insert
else
# process auto-setup
printf "\nVerifying environment variables... " printf "\nVerifying environment variables... "
# check for missing environment variable values # check for missing environment variable values
@ -65,13 +72,22 @@ case "$SMARTHOST_ENCRYPTION" in
;; ;;
esac esac
# append configuration and remove temp file
cat /tmp/main.cf.insert >> /etc/postfix/main.cf cat /tmp/main.cf.insert >> /etc/postfix/main.cf
rm -f /tmp/main.cf.insert \rm -f /tmp/main.cf.insert
fi
printf "done\n"
if [ -f "/etc/postfix/master.cf.override" ]; then
# use provided configuration file
printf "\nUsing provided MASTER configuration... "
\cp --force /etc/postfix/master.cf.override /etc/postfix/master.cf
else
# update master.cf # update master.cf
sed -i 's/#tlsproxy/tlsproxy/' /etc/postfix/master.cf sed -i 's/#tlsproxy/tlsproxy/' /etc/postfix/master.cf
fi
printf "done\n" printf "done\n"
printf "container setup complete!\n" printf "container setup complete!\n"
# run CMD passed to this container # run CMD passed to this container