Subversion Repositories

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

Rev 20 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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