~ubuntu-branches/ubuntu/hoary/postfix/hoary-security

« back to all changes in this revision

Viewing changes to auxiliary/MacOSX/activate-postfix

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-10-06 11:50:33 UTC
  • Revision ID: james.westby@ubuntu.com-20041006115033-ooo6yfg6kmoteu04
Tags: upstream-2.1.3
ImportĀ upstreamĀ versionĀ 2.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Written by Gerben Wierda, Oct 2001. I waive every copyright on this and
 
4
# I also do not give any warranty.
 
5
 
 
6
. ./defines
 
7
 
 
8
# Activate binaries
 
9
if [ ! -e ${POSTFIXBACKUPDIR}/sendmail ]
 
10
then
 
11
        echo "Something is wrong: there is no existing postfix binary backup"
 
12
        exit 1;
 
13
else
 
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 -)
 
18
fi
 
19
 
 
20
if [ -e "${PSI}" ]
 
21
then
 
22
        echo "Postfix StartupItem already exists."
 
23
else
 
24
        if [ -e "${PSIDISABLED}" ]
 
25
        then
 
26
                echo "Reinstating disabled Postfix StartupItem..."
 
27
                mv "${PSIDISABLED}" "${PSI}"
 
28
        else
 
29
                echo "Installing new default Postfix StartupItem..."
 
30
                cp -R Postfix.StartupItem "${PSI}"
 
31
        fi
 
32
fi
 
33
 
 
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
 
39
else
 
40
        echo "POSTFIX=-YES-" >>/etc/hostconfig
 
41
fi
 
42
 
 
43
/usr/sbin/postfix start