Modification : $vm_ -> $local_ .
[lhc/ateliers.git] / etc / sv / dovecot / local.sh
index 7f68365..9b0f37b 100644 (file)
@@ -1,10 +1,12 @@
 "$tool"/local/apt-get-install dovecot-imapd dovecot-managesieved dovecot-sieve
 "$tool"/local/insserv-remove  dovecot
-local hint="run before: ./vm_remote runit_configure dovecot"
-assert "sudo test -f /etc/dovecot/\"$vm_domainname\"/imap/x509/key.pem" hint
+
+sudo test -f /etc/dovecot/\"$local_domainname\"/imap/x509/key.pem ||
+printf '%s\n' "$(tput rev)run before: remote/runit-configure dovecot$(tput sgr0)" && exit 1
+
 sudo install -m 400 -o root -g root \
- "$tool"/var/pub/x509/imap."$vm_domainname"/crt+crl.self-signed.pem \
-    /etc/dovecot/"$vm_domainname"/imap/x509/crt+crl.self-signed.pem
+ "$tool"/var/pub/x509/imap."$local_domainname"/crt+crl.self-signed.pem \
+    /etc/dovecot/"$local_domainname"/imap/x509/crt+crl.self-signed.pem
 sudo install -d -m 770 -o root -g root \
  /etc/skel/etc/mail \
  /etc/skel/etc/sieve
@@ -12,7 +14,7 @@ sudo install -d -m 1777 -o root -g root \
  /var/lib/dovecot-control \
  /var/lib/dovecot-index
 m4 \
- --define=VM_DOMAINNAME=$vm_domainname \
+ --define=LOCAL_DOMAINNAME=$local_domainname \
  <"$tool"/etc/dovecot/local.conf.m4 |
 sudo install -m 644 -o root -g root /dev/stdin \
  /etc/dovecot/local.conf