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 source ${HOME}/bin/script_framework.sh
function usage() { 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" KEY_NAME="loki"
PORT="22" PORT="22"
while getopts ":k:p:" o; do while getopts ":k:p:" o; do
case "${o}" in case "${o}" in
k) k)
KEY_NAME="${OPTARG}" KEY_NAME="${OPTARG}"
;; ;;
p) p)
PORT="${OPTARG}" PORT="${OPTARG}"
;; ;;
*) *)
usage usage
;; ;;
esac esac
done done
shift $((OPTIND - 1)) shift $((OPTIND - 1))
@ -37,4 +37,4 @@ step "Loading key ${KEY_NAME}"
vault-sshadd "${KEY_NAME}" vault-sshadd "${KEY_NAME}"
step "Executing ssh" step "Executing ssh"
exec ssh -p ${PORT} "${HOST}" "$@" exec env TERM=xterm-color ssh -p ${PORT} "${HOST}" "$@"