Set TERM variable for older remote servers

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2022-10-24 13:02:05 +02:00
parent 55eb1789c7
commit 22dc4efdd9
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -4,24 +4,24 @@ set -euo pipefail
source ${HOME}/bin/script_framework.sh
function usage() {
fail "Missing parameters. Usage: $(basename $0) [-k <key>] [-p <port>] -- <host> [ssh-param ...]"
fail "Missing parameters. Usage: $(basename $0) [-k <key>] [-p <port>] -- <host> [ssh-param ...]"
}
KEY_NAME="loki"
PORT="22"
while getopts ":k:p:" o; do
case "${o}" in
k)
KEY_NAME="${OPTARG}"
;;
p)
PORT="${OPTARG}"
;;
*)
usage
;;
esac
case "${o}" in
k)
KEY_NAME="${OPTARG}"
;;
p)
PORT="${OPTARG}"
;;
*)
usage
;;
esac
done
shift $((OPTIND - 1))
@ -37,4 +37,4 @@ step "Loading key ${KEY_NAME}"
vault-sshadd "${KEY_NAME}"
step "Executing ssh"
exec ssh -p ${PORT} "${HOST}" "$@"
exec env TERM=xterm-color ssh -p ${PORT} "${HOST}" "$@"