Priprema za bullseye, ne briĊĦemo se iz prerm
[amavisd-cn.git] / src / postfixize.sh
1 #!/bin/sh
2 # last update: jelly+paketi@srce.hr  Mon Oct 30 13:56:00 CET 2006
3
4 set -e
5
6 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
7
8 PATH=/bin:/usr/bin:/sbin:/usr/sbin
9 export PATH
10
11 . /usr/share/amavisd-cn/version.sh
12 . /usr/share/carnet-tools/functions.sh
13 . /usr/share/amavisd-cn/variables.sh
14 . /usr/share/amavisd-cn/functions.sh
15
16 # find out which MTA, assume postfix
17 mta=postfix
18 ACONFTMPL=$POSTTMPL
19 TMPLVERSION=$POSTTMPLVERSION
20 if dpkg -l postfix | grep -q '^.i'; then
21   . /usr/share/amavisd-cn/postfix.sh
22 else
23   # should never happen
24   echo "CN: Don't invoke this script unless you have $mta installed!" >&2
25   exit 1
26 fi 
27
28 # postfix config
29 if [ "$mta" = postfix ]; then
30   update_postfix
31   conf_postfixize
32 fi # end postfix config
33
34 # nonexistent or empty config
35 if [ ! -f $ACONF -o ! -s $ACONF ]; then
36   # should never happen
37   echo "CN: Can't find $ACONF?!" >&2
38   exit 2
39 fi
40
41 # START AMAVISD
42 if [ "$restart_daemon" -a -x /etc/init.d/amavisd-new ]; then
43   /etc/init.d/amavisd-new restart
44 fi
45 # always check that the daemons are running
46 if ! wait_for_fds amavis; then
47   /etc/init.d/amavisd-new start < /dev/null 
48   wait_for_fds amavis
49 fi