summaryrefslogtreecommitdiff
path: root/mail/squirreloutlook/files/pkg-deinstall.in
blob: 40360fd7012f21247df5416f2aaf3c620b27de9a (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
42
43
#!/bin/sh
#
#	$FreeBSD: /tmp/pcvs/ports/mail/squirreloutlook/files/Attic/pkg-deinstall.in,v 1.1 2007-01-08 23:03:14 miwi Exp $
#

#set -vx

PKG_BATCH=${BATCH:=NO}

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

SQUIRRELDIR=%%SQUIRRELDIR%%

checkfile() {
        diff -bBqw $1 $2 >/dev/null 2>&1
        case $? in
                0)      # config file exists, but is the same
			rm $1
                        ;;
                1)      # config file exists and differs
                        ;;
                *)      # no config file exists
                        ;;
        esac
}

case $2 in
	DEINSTALL)
		cd ${PKG_PREFIX}
		checkfile /var/spool/squirrelmail/prefs/default_pref \
			${SQUIRRELDIR}/data/default_pref
		;;
	POST-DEINSTALL)
		if [ "${PKG_BATCH}" = "NO" ]; then
			echo "If you are no longer going to use SquirrelOutlook"
			echo "you should remove the /var/spool/squirrelmail"
			echo "directory with:"
			echo
			echo "	rm -rf /var/spool/squirrelmail"
		fi
		;;

esac