2016-12-09 20:39:02 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-12-13 07:58:53 +01:00
|
|
|
trap "postfix stop" EXIT
|
2016-12-09 20:39:02 +01:00
|
|
|
|
2016-12-15 10:07:46 +01:00
|
|
|
sed -i "/^user/c\user = ${DBUSER}" /opt/postfix/conf/sql/*
|
|
|
|
sed -i "/^password/c\password = ${DBPASS}" /opt/postfix/conf/sql/*
|
|
|
|
sed -i "/^dbname/c\dbname = ${DBNAME}" /opt/postfix/conf/sql/*
|
|
|
|
|
2017-01-12 20:16:01 +01:00
|
|
|
postconf -c /opt/postfix/conf
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
echo "Postfix configuration error, refusing to start."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
postfix -c /opt/postfix/conf start
|
|
|
|
sleep infinity
|
|
|
|
fi
|