Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 1 | Rev 15 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 3
1
#!/bin/sh
1
#!/bin/sh
2
set -e
2
set -e
3
3
4
. /usr/share/debconf/confmodule
4
. /usr/share/debconf/confmodule
5
5
6
LOCALSCANCONF=/etc/exim4/conf.d/main/15_sa-exim_plugin_path
6
LOCALSCANCONF=/etc/exim4/conf.d/main/15_sa-exim_plugin_path
7
DISABLELOCALSCANTEXT='# sa-exim plugin is disabled, because it was uninstalled'
7
DISABLELOCALSCANTEXT='# sa-exim plugin is disabled, because it was uninstalled'
8
DISABLELOCALSCANMD5=`echo "${DISABLELOCALSCANTEXT}" | md5sum | cut -d\  -f1`
8
DISABLELOCALSCANMD5=`echo "${DISABLELOCALSCANTEXT}" | md5sum | cut -d\  -f1`
9
9
10
case "$1" in
10
case "$1" in
11
    remove)
11
    remove)
12
        # disable local_scan_path directive to exim working
12
        # disable local_scan_path directive to exim working
13
	if [ -e "$LOCALSCANCONF" ] && [ ! -e "${LOCALSCANCONF}.rul" ]; then
13
	if [ -e "$LOCALSCANCONF" ] && [ ! -e "${LOCALSCANCONF}.rul" ]; then
14
	    echo "${DISABLELOCALSCANTEXT}" > ${LOCALSCANCONF}.rul
14
	    echo "${DISABLELOCALSCANTEXT}" > ${LOCALSCANCONF}.rul
15
	fi
15
	fi
16
	if [ -x /etc/init.d/exim4 ]; then
16
	if [ -x /etc/init.d/exim4 ]; then
17
		if [ -x /usr/sbin/invoke-rc.d ]; then
17
		if [ -x /usr/sbin/invoke-rc.d ]; then
18
			invoke-rc.d exim4 reload || true
18
			invoke-rc.d exim4 reload || true
19
		else
19
		else
20
			/etc/init.d/exim4 reload || true
20
			/etc/init.d/exim4 reload || true
21
		fi
21
		fi
22
	fi
22
	fi
23
	;;
23
	;;
24
24
25
    purge)
25
    purge)
26
        # clean up temporary file generated by postrm uninstall
26
        # clean up temporary file generated by postrm uninstall
27
	if [ -e "${LOCALSCANCONF}.rul" ] && \
27
	if [ -e "${LOCALSCANCONF}.rul" ] && \
28
	   [ "`md5sum ${LOCALSCANCONF}.rul | cut -d\  -f1`" = "${DISABLELOCALSCANMD5}" ]; then
28
	   [ "`md5sum ${LOCALSCANCONF}.rul | cut -d\  -f1`" = "${DISABLELOCALSCANMD5}" ]; then
29
	   rm ${LOCALSCANCONF}.rul
29
	   rm ${LOCALSCANCONF}.rul
30
	fi
30
	fi
31
	if [ -x /etc/init.d/exim4 ]; then
31
	if [ -x /etc/init.d/exim4 ]; then
32
		if [ -x /usr/sbin/invoke-rc.d ]; then
32
		if [ -x /usr/sbin/invoke-rc.d ]; then
33
			invoke-rc.d exim4 reload || true
33
			invoke-rc.d exim4 reload || true
34
		else
34
		else
35
			/etc/init.d/exim4 reload || true
35
			/etc/init.d/exim4 reload || true
36
		fi
36
		fi
37
	fi
37
	fi
38
	if [ -e /var/spool/sa-exim ] && ! rmdir /var/spool/sa-exim 2>/dev/null ; then
38
	if [ -e /var/spool/sa-exim ] && ! rmdir /var/spool/sa-exim 2>/dev/null ; then
39
		db_version 2.0
39
		db_version 2.0
40
		db_input medium sa-exim/purge_spool || true
40
		db_input medium sa-exim/purge_spool || true
41
		db_go || true
41
		db_go || true
42
		db_get sa-exim/purge_spool
42
		db_get sa-exim/purge_spool
43
		purge_spool="$RET"
43
		purge_spool="$RET"
44
		if [ "x${purge_spool}" = "xtrue" ] ; then
44
		if [ "x${purge_spool}" = "xtrue" ] ; then
45
			rm -rf /var/spool/sa-exim
45
			rm -rf /var/spool/sa-exim
46
		fi
46
		fi
47
	fi
47
	fi
48
	;;
48
	;;
49
esac
49
esac
50
50
51
#DEBHELPER#
51
#DEBHELPER#