]> git.ipfire.org Git - people/ms/dma.git/blob - postinst
Disable default delivery by default, reword the README.Debian text, and
[people/ms/dma.git] / postinst
1 #!/bin/sh
2 # postinst script for dma
3
4 set -e
5
6 . /usr/share/debconf/confmodule
7 db_version 2.0
8
9 umask 022
10
11 case "$1" in
12 configure)
13 db_get dma/mailname
14 echo "$RET" > /etc/mailname
15
16 db_get dma/relayhost
17 if [ -n "$RET" ]; then
18 sed -i -re 's@^[[:space:]]*(#+[[:space:]]*)?SMARTHOST([[:space:]]+.*)?$@SMARTHOST '"$RET@" /etc/dma/dma.conf
19 else
20 sed -i -re 's@^[[:space:]]*(#+[[:space:]]*)?SMARTHOST([[:space:]]+.*)?$@#SMARTHOST@' /etc/dma/dma.conf
21 fi
22
23 db_get dma/dbounceprog
24 if [ -n "$RET" ]; then
25 sed -i -re 's/^[[:space:]]*(#+[[:space:]]*)?DBOUNCEPROG([[:space:]]+.*)?$/DBOUNCEPROG '"$RET/" /etc/dma/dma.conf
26 else
27 sed -i -re 's/^[[:space:]]*(#+[[:space:]]*)?DBOUNCEPROG([[:space:]]+.*)?$/#DBOUNCEPROG/' /etc/dma/dma.conf
28 fi
29
30 if dpkg --compare-versions "$2" lt '0.0.2009.07.17-3'; then
31 chown root:mail /etc/dma/*
32 chmod 640 /etc/dma/*
33 fi
34 ;;
35
36 abort-upgrade|abort-remove|abort-deconfigure)
37 ;;
38
39 *)
40 echo "postinst called with unknown argument \`$1'" >&2
41 exit 1
42 ;;
43 esac
44
45 # dh_installdeb will replace this with shell code automatically
46 # generated by other debhelper scripts.
47
48 #DEBHELPER#
49
50 exit 0