dustin
/
zdotdir
Archived
1
0
Fork 0
This repository has been archived on 2023-11-14. You can view files and clone it, but cannot push or open issues/pull-requests.
zdotdir/functions/@testvm::connect

23 lines
498 B
Bash

# vim: set ft=zsh sw=4 ts=4 sts=4 et :
@testvm::connect() {
local _term
local testvm_domain=${TESTVM_DOMAIN:-dustin.test}
local testvm="${1}"
shift
if [ -z "${SSHPASS}" ]; then
export SSHPASS='F!r3m0n1'
fi
case ${TERM} in
[Aa]lacritty)
_term=xterm-256color
;;
esac
if [[ ! "${testvm}" = *.* ]]; then
testvm="${testvm}.${testvm_domain}"
fi
TERM=${_term:-${TERM}} sshpass -e ssh ${testvm} "$@"
}
@testvm::connect "$@"