Subversion Repositories

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

Rev 15 | Rev 79 | Go to most recent revision | 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
19
		if [ -x /usr/sbin/invoke-rc.d ]; then
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
34
		if [ -x /usr/sbin/invoke-rc.d ]; then
35
			invoke-rc.d exim4 reload || true
36
		else
37
			/etc/init.d/exim4 reload || true
38
		fi
39
	fi
15 magnus 40
        # In the rather uncommon event that debconf has been removed before
41
        # us, we have no choice but leaving the spool directory alone.
20 magnus 42
	if [ -e /var/spool/sa-exim ] &&
43
           ! rmdir /var/spool/sa-exim 2>/dev/null &&
44
           [ -f /usr/share/debconf/confmodule ]; then
1 magnus 45
		db_version 2.0
46
		db_input medium sa-exim/purge_spool || true
47
		db_go || true
48
		db_get sa-exim/purge_spool
49
		purge_spool="$RET"
50
		if [ "x${purge_spool}" = "xtrue" ] ; then
51
			rm -rf /var/spool/sa-exim
52
		fi
53
	fi
54
	;;
55
esac
56
 
57
#DEBHELPER#