Modification : etc/aliases -> etc/postfix/aliases .
[lhc/ateliers.git] / vm_hosted
index 3f5c747..d0dec72 100755 (executable)
--- a/vm_hosted
+++ b/vm_hosted
@@ -1,6 +1,10 @@
 #!/bin/sh
 set -e -f ${DRY_RUN:+-n} -u
-tool=${0%/*}
+tool=$0
+while test -L "$tool"
+ do tool=$(readlink "$tool")
+ done
+tool=${tool%/*}
 . "$tool"/lib/rule.sh
 . "$tool"/etc/vm.sh
 
@@ -30,6 +34,7 @@ rule_git_configure () {
        local tool
        tool=$(cd "$tool"; cd -)
        sudo ln -fns "$tool"/vm_hosted /usr/local/sbin/
+       sudo ln -fns "$tool"/vm_hosted /usr/local/sbin/vm
        )
  }
 rule_git_reset () {
@@ -207,8 +212,8 @@ rule_etckeeper_configure () {
                LOWLEVEL_PACKAGE_MANAGER=dpkg
                EOF
        sudo install -m 644 -o root -g root \
-         etc/etckeeper/prompt.sh \
-        /etc/etckeeper/prompt.sh
+        "$tool"/etc/etckeeper/prompt.sh \
+               /etc/etckeeper/prompt.sh
        rule apt_get_install etckeeper
  }
 rule_filesystem_configure () {
@@ -417,6 +422,9 @@ rule_postfix_configure () {
        assert "test -f /etc/postfix/$vm_domainname/smtpd/x509/key.pem" hint
        warn "lors de l'installation Debian, ne sélectionner aucune configuration pour postfix"
        rule apt_get_install postfix
+       sudo install -m 640 -o root -g root /dev/stdin /etc/postfix/.gitignore <<-EOF
+               *.db
+               EOF
        sudo install -d -m 770 -o root -g root \
         /etc/postfix/$vm_domainname/ \
         /etc/postfix/$vm_domainname/smtp \
@@ -452,9 +460,9 @@ rule_postfix_configure () {
          etc/postfix/$vm_domainname/header_checks \
         /etc/postfix/$vm_domainname/header_checks
        sudo install -m 664 -o root -g root \
-         etc/aliases \
-        /etc/aliases
-       sudo newaliases
+         etc/postfix/aliases \
+        /etc/postfix/aliases
+       sudo newaliases -oA/etc/postfix/aliases
        cat /dev/stdin etc/postfix/main.cf <<-EOF |
                mydomain      = $vm_domainname
                myorigin      = \$mydomain