X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=vm_remote;h=a1afa1a940e068083c571092b9de4c487caeb893;hb=43dd7fe293ce4a22153053218645a1a6282ab485;hp=19ce8d4cb654f7de6d6d8ee9c94fa974dee6bda6;hpb=fe76c838090f262ec477c6a73d1bf9d988033b56;p=lhc%2Fateliers.git diff --git a/vm_remote b/vm_remote index 19ce8d4..a1afa1a 100755 --- a/vm_remote +++ b/vm_remote @@ -28,20 +28,24 @@ 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 local remote=${1#remote=}; shift GIT_SSH=./vm_ssh git push -v "$remote" "$@" + info "penser à faire : vm_hosted git_reset" } 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 \ @@ -50,7 +54,7 @@ rule__ssh_known_hosts_update () { whoami } rule_key_disk_send () { - gpg --decrypt var/lib/luks/$vm_fqdn.key.gpg | + gpg --decrypt var/sec/luks/$vm_fqdn.key.gpg | "$tool"/vm_ssh root@$vm_fqdn "$@" \ -o CheckHostIP=no \ -o HostKeyAlias=init.$vm_fqdn \ @@ -59,7 +63,7 @@ rule_key_disk_send () { rule_key_disk_backup () { for part in root var home do - mkdir -p var/lib/luks + mkdir -p var/sec/luks rule ssh -l root ' \ tmp=$(mktemp) cryptsetup luksHeaderBackup \ @@ -69,7 +73,7 @@ rule_key_disk_backup () { shred --remove "$tmp" ' | gpg --encrypt --recipient $USER@ \ - -o var/lib/luks/${vm_lvm_lv}_${part}.luks.gpg + -o var/sec/luks/${vm_lvm_lv}_${part}.luks.gpg done }