c5ae7537 |
1 | #!/bin/sh -e |
2 | |
ca36ffec |
3 | redo_exim() { |
4 | /bin/echo -n "domainlist local_domains = " >/etc/exim4/conf.d/main/10_domtool-domains |
5 | /bin/cat /var/domtool/local_domains.cfg >>/etc/exim4/conf.d/main/10_domtool-domains |
6 | /bin/echo "" >>/etc/exim4/conf.d/main/10_domtool-domains |
7 | /bin/echo -n "domainlist relay_to_domains = " >>/etc/exim4/conf.d/main/10_domtool-domains |
8 | /bin/cat /var/domtool/relay_domains.cfg >>/etc/exim4/conf.d/main/10_domtool-domains |
9 | /bin/echo "" >>/etc/exim4/conf.d/main/10_domtool-domains |
10 | /bin/echo -n "domainlist mm_domains = " >>/etc/exim4/conf.d/main/10_domtool-domains |
11 | /bin/cat /var/domtool/mailman_domains.cfg >>/etc/exim4/conf.d/main/10_domtool-domains |
12 | /bin/echo "" >>/etc/exim4/conf.d/main/10_domtool-domains |
13 | /etc/init.d/exim4 reload |
14 | } |
15 | |
c5ae7537 |
16 | case $1 in |
17 | apache) |
008169da |
18 | /usr/bin/rsync -r --delete /var/domtool/vhosts/ /etc/apache2/vhosts/ |
771615a8 |
19 | /etc/init.d/apache2 reload |
c5ae7537 |
20 | ;; |
8bd6a399 |
21 | apache-down) |
22 | /etc/init.d/apache2 stop |
23 | ;; |
24 | apache-undown) |
008169da |
25 | /usr/bin/rsync -r --delete /var/domtool/vhosts/ /etc/apache2/vhosts/ |
8bd6a399 |
26 | /etc/init.d/apache2 start |
27 | ;; |
c829302a |
28 | apache1.3) |
29 | /usr/bin/rsync -r --delete /var/domtool/vhosts/ /etc/apache/vhosts/ |
30 | /etc/init.d/apache reload |
31 | ;; |
32 | apache1.3-down) |
33 | /etc/init.d/apache stop |
34 | ;; |
35 | apache1.3-undown) |
36 | /usr/bin/rsync -r --delete /var/domtool/vhosts/ /etc/apache/vhosts/ |
37 | /etc/init.d/apache start |
38 | ;; |
c5ae7537 |
39 | bind) |
008169da |
40 | /usr/bin/rsync -r --delete /var/domtool/zones/ /etc/bind/zones/ |
a737c4bc |
41 | /bin/chown -R bind /etc/bind/zones |
c5ae7537 |
42 | /bin/cp /var/domtool/named.conf.local /etc/bind/ |
a737c4bc |
43 | /bin/chown root:bind_config /etc/bind/named.conf.local |
b47a8708 |
44 | /bin/chmod u=rw,g=rw,o=r /etc/bind/named.conf.local |
771615a8 |
45 | /etc/init.d/bind9 reload |
c5ae7537 |
46 | ;; |
47 | exim) |
dcf0de89 |
48 | /bin/cp /var/domtool/aliases /etc/aliases.hosted |
3f71121b |
49 | /bin/cp /var/domtool/aliases.default /etc/aliases.wildcard |
ca36ffec |
50 | redo_exim |
c5ae7537 |
51 | ;; |
52 | mailman) |
fe7ce905 |
53 | /bin/echo "HCOOP_VHOSTS = {" >/etc/mailman/vhosts_cfg.py |
54 | /bin/cat /var/domtool/mailman.map >>/etc/mailman/vhosts_cfg.py |
55 | /bin/echo "}" >>/etc/mailman/vhosts_cfg.py |
771615a8 |
56 | /etc/init.d/mailman reload |
ca36ffec |
57 | redo_exim |
c5ae7537 |
58 | ;; |
c45f1662 |
59 | courier) |
36f66a0c |
60 | /usr/sbin/makeuserdb |
cf6d96ab |
61 | /bin/chown -R domtool.domtool /etc/courier/userdb |
c685120e |
62 | /bin/cat /etc/courier/userdb/* >/etc/courier/exim |
63 | /bin/chmod o-r /etc/courier/exim |
64 | /usr/sbin/exim_dbmbuild /etc/courier/exim /etc/courier/exim.dat |
65 | /bin/chgrp mail /etc/courier/exim.dat |
66 | /bin/chmod o-r /etc/courier/exim.dat |
67 | ;; |
68 | smtplog) |
69 | /bin/grep $2 /var/log/exim4/mainlog |
c45f1662 |
70 | ;; |
073e0aa1 |
71 | apache-fixperms) |
72 | /bin/chown -R domtool.domtool /var/log/apache2/user |
73 | ;; |
74 | apache1.3-fixperms) |
75 | /bin/chown -R domtool.domtool /var/log/apache/user |
76 | ;; |
c5ae7537 |
77 | *) |
4e40058b |
78 | echo "Usage: domtool-publish [apache|bind|courier|exim|mailman|smtplog STRING]" |
c5ae7537 |
79 | ;; |
37a12f3f |
80 | esac |