summaryrefslogtreecommitdiff
path: root/mail/yatsvrs/DEINSTALL
blob: a7e9d0d4d0c63208f18ddc05181c008b4bdb1fe1 (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
#!/bin/sh
# $Id: DEINSTALL,v 1.3 2004/12/15 13:18:02 taca Exp $

YAT_CONF_DIR="@PKG_SYSCONFDIR@"
DEFAULT_ADMIN="@DEFAULT_ADMIN@"
MIN="@YATSVR_MINGID@"
MAX="@YATSVR_MAXGID@"

case "$2" in
DEINSTALL)

	admin=`${CAT} ${YAT_CONF_DIR}/.admin`
	if [ "$admin" = "${DEFAULT_ADMIN}" ]; then
		${RM} -f ${YAT_CONF_DIR}/.admin
	fi
	${AWK} -F: '$1 !~ /^no/ { if ($3 < '$MIN' || $3 > '$MAX') print $1}' \
		/etc/group > /tmp/hidden-group
	if ${CMP} -s ${YAT_CONF_DIR}/.hidden-group /tmp/hidden-group; then
		${RM} -f ${YAT_CONF_DIR}/.hidden-group
	fi
	${RM} -f /tmp/hidden-group
	${RM} -f ${YAT_CONF_DIR}/*\~old
	;;
esac