Create a wrapper around ssh

To check if we're trying to ssh to a VM so the VM can be booted if it is
off

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2021-11-29 15:04:55 -05:00
parent b1fa0acd1f
commit f4a1f40eff
2 changed files with 19 additions and 0 deletions

15
completions/_ssh.zsh Normal file
View File

@ -0,0 +1,15 @@
#compdef ssh.zsh
function _ssh.zsh() {
_arguments \
':args: _alternative
"hosts:hosts: _ssh_hosts"
"users:users: _ssh.zsh_users -qS@"
"domains:domains:($(virsh list --all --name))"'
}
_ssh.zsh_users () {
_combination -s '[:@]' my-accounts users-hosts users "$@"
}
_ssh.zsh "$@"

4
ssh.zsh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/zsh
vm.zsh boot $1
ssh $*