aboutsummaryrefslogtreecommitdiffstats
path: root/security/cyrus-sasl2/pkg-deinstall
blob: 9e18cc7e18edd09b0af9da7554becfeb9dbd3c88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
#
#   $FreeBSD$
#
# Created by: hetzels@westbend.net

#set -vx

PKG_BATCH=${BATCH:=NO}

PKG_PREFIX=${PKG_PREFIX:=/usr/local}

SASLDB_NAME=${PKG_PREFIX}/etc/%%SASLDB%%

# delete sasldb database

delete_sasldb() {
    [ -f ${SASLDB_NAME} -a ! -s ${SASLDB_NAME} ] && rm ${SASLDB_NAME}
}

# This should really be uninstalled by Sendmail

sendmail_conf() {
    if [ -f ${PKG_PREFIX}/lib/sasl/Sendmail.conf ]; then
        echo "pwcheck_method: pwcheck" > ${PKG_PREFIX}/lib/sasl/Sendmail.conf.tmp
        if cmp -s ${PKG_PREFIX}/lib/sasl/Sendmail.conf ${PKG_PREFIX}/lib/sasl/Sendmail.conf.tmp; then
            rm -f ${PKG_PREFIX}/lib/sasl/Sendmail.conf
        fi
        rm -f ${PKG_PREFIX}/lib/sasl/Sendmail.conf.tmp
    fi
}

case $2 in
    DEINSTALL)
        delete_sasldb
        sendmail_conf
        ;;
    POST-DEINSTALL)
        ;;

esac