scripts/preexec.zsh
Anna Schumaker ab780cd3a8 Remove ssh.zsh and replace with a preexec.zsh script
This script is configured to intercept the `ssh` command and boot the
associated VM

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2021-12-02 15:49:42 -05:00

13 lines
241 B
Bash
Executable File

#!/bin/zsh
#
# Be sure to add:
# preexec() { /path/to/script/preexec.zsh $* }
# to your .zshrc
cmd=($(echo "$1" | sed 's/\-\w //g'))
# Boot offline VMs
if [[ $cmd[1] == "ssh" ]]; then
vm.zsh boot $(echo $cmd[2] | sed 's/^\w*@//')
fi