Subversion Repositories

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

Rev 80 | Details | Compare with Previous | Last modification | View Log | RSS feed

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