Correction : vm_hosted : gitweb.
[lhc/ateliers.git] / vm_remote
index 0fa0165..41de663 100755 (executable)
--- a/vm_remote
+++ b/vm_remote
@@ -1,6 +1,10 @@
 #!/bin/sh
 set -e -f ${DRY_RUN:+-n} -u
 #!/bin/sh
 set -e -f ${DRY_RUN:+-n} -u
-tool=$(cd "${0%/*}"; cd -)
+tool=$0
+while test -L "$tool"
+ do tool=$(readlink "$tool")
+ done
+tool=${tool%/*}
 . "$tool"/lib/rule.sh
 . "$tool"/etc/vm.sh
 
 . "$tool"/lib/rule.sh
 . "$tool"/etc/vm.sh
 
@@ -98,7 +102,7 @@ rule_apache2_key_send () {
         do conf=${conf#"$tool"/etc/nginx/site.d/}
                local site=${conf%/key_send}
                rule _x509_site_key_decrypt \
         do conf=${conf#"$tool"/etc/nginx/site.d/}
                local site=${conf%/key_send}
                rule _x509_site_key_decrypt \
-                "$(cat "$tool"/etc/apache2/site.d/"$site"/key_send)" |
+                "$(cat "$tool"/etc/apache2/site.d/"$site"/x509_host)" |
                rule ssh -l root ' \
                        sudo install -d -m 770 -o '"$user"' -g '"$user"' \
                         /etc/apache2 \
                rule ssh -l root ' \
                        sudo install -d -m 770 -o '"$user"' -g '"$user"' \
                         /etc/apache2 \
@@ -146,10 +150,10 @@ rule_nginx_configure () {
        for conf in "$tool"/etc/nginx/site.d/*/site.conf
         do conf=${conf#"$tool"/etc/nginx/site.d/}
                local site="${conf%/site.conf}"
        for conf in "$tool"/etc/nginx/site.d/*/site.conf
         do conf=${conf#"$tool"/etc/nginx/site.d/}
                local site="${conf%/site.conf}"
-               if test -f "$tool"/etc/nginx/site.d/"$site"/key_send
+               if test -f "$tool"/etc/nginx/site.d/"$site"/x509_host
                 then
                        rule _x509_site_key_decrypt \
                 then
                        rule _x509_site_key_decrypt \
-                        "$(cat "$tool"/etc/nginx/site.d/"$site"/key_send)" |
+                        "$(cat "$tool"/etc/nginx/site.d/"$site"/x509_host)" |
                        rule ssh -l root ' \
                                sudo install -d -m 770 -o root -g root \
                                 /etc/nginx \
                        rule ssh -l root ' \
                                sudo install -d -m 770 -o root -g root \
                                 /etc/nginx \