Generating Exim config file with domainlist
[hcoop/domtool2.git] / scripts / domtool-publish
... / ...
CommitLineData
1#!/bin/sh -e
2
3case $1 in
4 apache)
5 /usr/bin/rsync -r --delete /var/domtool/vhosts/ /etc/apache2/vhosts/
6 /etc/init.d/apache2 reload
7 ;;
8 apache-down)
9 /etc/init.d/apache2 stop
10 ;;
11 apache-undown)
12 /usr/bin/rsync -r --delete /var/domtool/vhosts/ /etc/apache2/vhosts/
13 /etc/init.d/apache2 start
14 ;;
15 bind)
16 /usr/bin/rsync -r --delete /var/domtool/zones/ /etc/bind/zones/
17 /bin/cp /var/domtool/named.conf.local /etc/bind/
18 /etc/init.d/bind9 reload
19 ;;
20 exim)
21 /bin/cp /var/domtool/aliases /etc/
22 /bin/cp /var/domtool/aliases.default /etc/
23 /bin/echo -n "domainlist local_domains = " >/etc/exim4/conf.d/main/10_domtool-domains
24 /bin/cat /var/domtool/local_domains.cfg >>/etc/exim4/conf.d/main/10_domtool-domains
25 /bin/echo "" >>/etc/exim4/conf.d/main/10_domtool-domains
26 /etc/init.d/exim4 reload
27 ;;
28 mailman)
29 /bin/cp /var/domtool/mailman.map /etc/mailman
30 /etc/init.d/mailman reload
31 ;;
32 courier)
33 /bin/cat /etc/courier/userdb/* >/etc/courier/exim
34 /bin/chmod o-r /etc/courier/exim
35 /usr/sbin/exim_dbmbuild /etc/courier/exim /etc/courier/exim.dat
36 /bin/chgrp mail /etc/courier/exim.dat
37 /bin/chmod o-r /etc/courier/exim.dat
38 ;;
39 smtplog)
40 /bin/grep $2 /var/log/exim4/mainlog
41 ;;
42 *)
43 echo "Usage: domtool-publish [apache|bind|exim|mailman]"
44 ;;
45esac