allow to connect from ssh without DISPLAY

This commit is contained in:
Solène Rapenne 2023-06-09 23:50:53 +02:00
parent 3cfec305be
commit f1e69bf5ea

View File

@ -8,7 +8,6 @@ then
fi
HOST="${1}"
PROG="${2:-xterm}"
if echo "$HOST" | grep -v kube$
then
@ -40,4 +39,12 @@ then
fi
ssh-keygen -R "$HOST" >/dev/null 2>/dev/null
ssh -o StrictHostKeyChecking=no -Y user@$HOST "$PROG"
if [ -n "$DISPLAY" ]
then
PROG="${2:-xterm}"
ssh -o StrictHostKeyChecking=no -Y "user@${HOST}" "${PROG}"
else
PROG="${2:-}"
ssh -o StrictHostKeyChecking=no -Y "user@${HOST}" "${PROG}"
fi