Subversion Repositories

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

Rev 3 | Rev 20 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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