From ab8e7167ed1beabc1e9081d64603cf3801e51b31 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 23 May 2023 19:47:42 -0400 Subject: x11-ssh-host: pass through ssh options --- dot/local/bin/x11-ssh-host | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'dot/local/bin/x11-ssh-host') diff --git a/dot/local/bin/x11-ssh-host b/dot/local/bin/x11-ssh-host index 166f491..a8620a7 100755 --- a/dot/local/bin/x11-ssh-host +++ b/dot/local/bin/x11-ssh-host @@ -1,15 +1,21 @@ #!/bin/sh host=$(basename "$0") case "$host" in - x11-ssh-host) host=$1 ;; + x11-ssh-host) + for host in "$@" + do + continue + done + ;; esac SCRIPT="if which tmux && ! test -e .prefer-screen; then tmux attach || tmux new; else screen -xRR -e '^Zz'; fi" -if [ "$DISPLAY" -a ! -t 0 ]; then - exec xterm -T "$host" -e \ - autossh "$host" -- -t $SCRIPT +set -- autossh -- "$@" -t $SCRIPT + +if [ "$DISPLAY" -a ! -t 0 ] +then + exec xterm -T "$host" -e "$@" else - exec \ - autossh "$host" -- -t $SCRIPT + exec "$@" fi -- cgit v1.2.3