root/alternc-secondarymx/trunk/debian/postinst

Revision 2275, 1.2 kB (checked in by azerttyu, 1 month ago)

close #1148 (daniche)

le hash laisse entendre que c'est un repertoire hors au mieux c'est un fichier.
un .db généré par postmap commme le montre cet exemple : {{{
$:/var/cache/secondarymx# ls -la
total 40
drwxr-xr-x 2 root root 4096 2008-09-09 11:51 .
drwxr-xr-x 10 root root 4096 2008-09-09 11:01 ..
...
-rw-r--r-- 1 root root 2441 2008-09-09 11:51 secondarymx
-rw-r--r-- 1 root root 12288 2008-09-09 11:51 secondarymx.db
}}}

De plus il y a inconsistance avec le grep ligne 11, le grep valide bien mais ce n'est pas exactement pareil

Sans oublier que sans cette modfication "postfix ne savait meme pas causer le handchek 'ehlo' de smtp" (daniche)

Line 
1 #!/bin/sh -e
2
3 # FIXME : Code here :)
4 . /usr/share/debconf/confmodule
5
6 RESTART=""
7 POSTMAP="/var/cache/secondarymx/secondarymx"
8
9 function configure {
10     CONF="$1"
11     if grep -q "hash:/var/cache/secondarymx/secondarymx" "${CONF}"
12         then
13         echo "Postfix already configured."
14     else
15         echo "Configuring main.cf"
16         # FIXME: if there is no mydestination line, add one
17         if grep -q "^relay_domains" "${CONF}"
18             then
19             mv ${CONF} ${CONF}.dpkg-old
20             cat ${CONF}.dpkg-old | sed -e 's/^mydestination\(.*\)$/mydestination\1, hash\:\/var\/cache\/secondarymx\/secondarymx' >${CONF}
21         else
22             echo 'relay_domains = \$mydestination, hash:/var/cache/secondarymx/secondarymx/' >>${CONF}
23         fi
24         RESTART="YES"
25     fi
26 }
27
28 case "$1" in
29     configure)
30         touch /etc/bind/secondarymx.conf
31         # Configure alternc-secondarymx (if AlternC is installed on this server ...)
32         if [ -f /usr/share/alternc/install/etc/bind/named.conf ]
33             then
34             configure /etc/alternc/templates/etc/postfix/main.cf
35         fi
36         configure /etc/postfix/main.cf
37         if [ "$RESTART" ]
38             then
39             touch ${POSTMAP}
40             postmap ${POSTMAP}
41             invoke-rc.d --quiet postfix restart
42         fi
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
Note: See TracBrowser for help on using the browser.