summaryrefslogtreecommitdiff
path: root/mail/cyrus-imapd24/DEINSTALL
blob: ad2ea1606ea15c0c8c497bb699f849984af7022d (plain)
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
# $NetBSD: DEINSTALL,v 1.1.1.1 2010/10/30 12:12:35 obache Exp $

IMAPDCONF=@IMAPDCONF@

case ${STAGE} in
DEINSTALL)
	if [ -f ${IMAPDCONF} ]; then
		IMAPDIRS=`
			${AWK} '/configdirectory:/      { print $2 };	\
				/partition-.*:/         { print $2 };	\
				/sievedir:/             { print $2 }'	\
				${IMAPDCONF} | ${SORT} -ur`
		_IMAPDIRS=
		for dir in ${IMAPDIRS}; do
			${RMDIR} -p ${dir} 2>/dev/null || ${TRUE}
			if [ -d ${dir} ]; then
				_IMAPDIRS="${_IMAPDIRS} ${dir}"
			fi
		done
		if [ -n "${_IMAPDIRS}" ]; then
			${CAT} << EOF
===========================================================================
If you won't be using ${PKGNAME} any longer, you may want to remove
the following directories:

EOF
			for dir in ${_IMAPDIRS}; do
				if [ -d "${dir}" ]; then
					${ECHO} "	${dir}"
				fi
			done
                	${CAT} << EOF
===========================================================================
EOF
		fi
	fi
	;;
esac