Updating alternc.install script to check if the certificate used by postfix exists.

This commit is contained in:
Steven Mondji-Lerider 2013-03-08 11:21:45 +00:00
parent 3f32183fe5
commit 2ca729b6a1
1 changed files with 18 additions and 1 deletions

View File

@ -335,7 +335,24 @@ else
postfix_conf=/etc/alternc/postfix.cf
fi
grep -v '^\ *#' $postfix_conf |while read line ; do
postconf -e "$line"
if echo "$line" | grep -qi '^smtpd_tls_cert_file' ;then
line_strip=`echo "$line"|tr -d '[:blank:]'`
pattern="*="
cert_file=${line_strip#$pattern}
if [ -e $cert_file ];then
postconf -e "$line"
else
echo "****************************************"
echo "The certificate file : $cert_file does not exists"
echo "please go to https://alternc.org/wiki/SSL to get information on how to create a certificate"
echo "Then edit the file /etc/alternc/postfix/postfix.cf to add"
echo "the cert file path name to the key :smtpd_tls_cert_file"
echo "Finally relaunch alternc.install"
echo "****************************************"
fi
else
postconf -e "$line"
fi
done
# Conviguring delivery used by Postfix