3
# Written by Gerben Wierda, Oct 2001. I waive every copyright on this and
4
# I also do not give any warranty.
9
if [ ! -e ${POSTFIXBACKUPDIR}/sendmail ]
11
echo "Something is wrong: there is no existing postfix binary backup"
14
echo "Restoring postfix versions of sendmail programs from backup..."
15
(cd ${POSTFIXBACKUPDIR}; tar cf - sendmail) | (cd /usr/sbin; tar xf -)
16
(cd ${POSTFIXBACKUPDIR}; tar cf - newaliases) | (cd /usr/bin; tar xf -)
17
(cd ${POSTFIXBACKUPDIR}; tar cf - mailq) | (cd /usr/bin; tar xf -)
22
echo "Postfix StartupItem already exists."
24
if [ -e "${PSIDISABLED}" ]
26
echo "Reinstating disabled Postfix StartupItem..."
27
mv "${PSIDISABLED}" "${PSI}"
29
echo "Installing new default Postfix StartupItem..."
30
cp -R Postfix.StartupItem "${PSI}"
34
# De-activate sendmail in /etc/hostconfig
35
/usr/bin/perl -pi -e 's/MAILSERVER=-YES-/MAILSERVER=-NO-/g' /etc/hostconfig
36
# Activate postfix in /etc/hostconfig
37
if /usr/bin/grep '^POSTFIX=-NO-' /etc/hostconfig >/dev/null 2>&1; then
38
/usr/bin/perl -pi -e 's/POSTFIX=-NO-/POSTFIX=-YES-/g' /etc/hostconfig
40
echo "POSTFIX=-YES-" >>/etc/hostconfig
43
/usr/sbin/postfix start