Ajout : vm_remote : rule_mosh .
[lhc/ateliers.git] / vm_remote
index 9b37839..8fe0561 100755 (executable)
--- a/vm_remote
+++ b/vm_remote
@@ -10,7 +10,8 @@ rule_help () { # SYNTAX: [--hidden]
                DESCRIPTION:
                  ce script regroupe des règles pour administrer la VM ($vm_fqdn)
                  _depuis_ une machine distante ;
-                 il sert à la fois d'outil et de documentation.
+                 il sert à la fois d'outil (aisément bidouillable)
+                 et de documentation (préçise).
                  Voir \`$tool/vm_host'   pour les règles côté machine hôte ($vm_host).
                  Voir \`$tool/vm_hosted' pour les règles côté VM hébergée ($vm_fqdn).
                SYNTAX: $0 \$RULE \${RULE}_SYNTAX
@@ -27,10 +28,10 @@ rule_git_config () { # DESCRIPTION: configure le .git local pour bien pousser
        cd "$tool"
        git remote rm host || true
        git remote add host $vm_host:tool/vm
-       git config --replace remote.host.push HEAD:refs/heads/origin
+       git config --replace remote.host.push HEAD:refs/remotes/master
        git remote rm hosted || true
        git remote add hosted root@$vm_fqdn:tool/vm
-       git config --replace remote.hosted.push HEAD:refs/heads/origin
+       git config --replace remote.hosted.push HEAD:refs/remotes/master
        )
  }
 rule_git_push () { # SYNTAX: {host|hosted} $git_push_options
@@ -41,6 +42,9 @@ rule_git_push () { # SYNTAX: {host|hosted} $git_push_options
 rule_ssh () {
        "$tool"/vm_ssh $vm_fqdn "$@"
  }
+rule_mosh () {
+       mosh --ssh="$tool/vm_ssh $*" $vm_fqdn
+ }
 rule__ssh_known_hosts_update () {
        rule ssh \
         -o StrictHostKeyChecking=no \