Rev 3 | 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. |
||
42 | if [ -e /var/spool/sa-exim ] && ! rmdir /var/spool/sa-exim 2>/dev/null |
||
43 | && [ -f /usr/share/debconf/confmodule ]; then |
||
1 | magnus | 44 | db_version 2.0 |
45 | db_input medium sa-exim/purge_spool || true |
||
46 | db_go || true |
||
47 | db_get sa-exim/purge_spool |
||
48 | purge_spool="$RET" |
||
49 | if [ "x${purge_spool}" = "xtrue" ] ; then |
||
50 | rm -rf /var/spool/sa-exim |
||
51 | fi |
||
52 | fi |
||
53 | ;; |
||
54 | esac |
||
55 | |||
56 | #DEBHELPER# |