Modifications : etc/sv/dovecot/remote.sh
[lhc/ateliers.git] / etc / sv / dovecot / remote.sh
index 0de2eaa..29c1e6b 100644 (file)
@@ -1,14 +1,26 @@
-rule _x509_site_key_decrypt imap."$vm_domainname" |
-rule ssh -l root ' \
-       sudo install -d -m 770 -o root -g root \
-        /etc/dovecot/'"$vm_domainname"'/ \
-        /etc/dovecot/'"$vm_domainname"'/imap \
-        /etc/dovecot/'"$vm_domainname"'/imap/x509 ; \
-       sudo install -m 644 -o root -g root /dev/stdin \
-        /etc/dovecot/'"$vm_domainname"'/imap/x509/.gitignore <<-EOF
-               key.pem
-               EOF
-       sudo install -m 400 -o root -g root \
-        /dev/stdin \
-        /etc/dovecot/"$vm_domainname"/imap/x509/key.pem
- '
+for domain in \
+ "$local_domainname" \
+ cyclocoop.org \
+ ptitvelo.net \
+ veli-velo.org
+
+ do
+       for protocol in imap pop
+        do
+               "$tool"/remote/site-x509-key-decrypt "$protocol"."$domain" |
+               "$tool"/remote/ssh root@"$local_fqdn" ' \
+                       sudo install -d -m 770 -o root -g php_roundcube \
+                        /etc/dovecot/dovecot.'"$domain"'/
+                       sudo install -d -m 770 -o root -g root \
+                        /etc/dovecot/dovecot.'"$domain"'/'"$protocol"' \
+                        /etc/dovecot/dovecot.'"$domain"'/'"$protocol"'/x509 ; \
+                       sudo install -m 644 -o root -g root /dev/stdin \
+                        /etc/dovecot/dovecot.'"$domain"'/'"$protocol"'/x509/.gitignore <<-EOF
+                               key.pem
+                               EOF
+                       sudo install -m 400 -o root -g root \
+                        /dev/stdin \
+                        /etc/dovecot/dovecot.'"$domain"'/'"$protocol"'/x509/key.pem
+                '
+        done
+ done