summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-05-23 19:47:42 -0400
committerAndrew Cady <d@jerkface.net>2024-01-19 12:01:02 -0500
commitab8e7167ed1beabc1e9081d64603cf3801e51b31 (patch)
treed4ee069436f143be6b6cebe6971d8f33a94adc16
parent43dc23666348072b9bf231abac4bb9f3d1a00b35 (diff)
x11-ssh-host: pass through ssh options
-rwxr-xr-xdot/local/bin/x11-ssh-host18
1 files changed, 12 insertions, 6 deletions
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 @@
1#!/bin/sh 1#!/bin/sh
2host=$(basename "$0") 2host=$(basename "$0")
3case "$host" in 3case "$host" in
4 x11-ssh-host) host=$1 ;; 4 x11-ssh-host)
5 for host in "$@"
6 do
7 continue
8 done
9 ;;
5esac 10esac
6 11
7SCRIPT="if which tmux && ! test -e .prefer-screen; then tmux attach || tmux new; else screen -xRR -e '^Zz'; fi" 12SCRIPT="if which tmux && ! test -e .prefer-screen; then tmux attach || tmux new; else screen -xRR -e '^Zz'; fi"
8 13
9if [ "$DISPLAY" -a ! -t 0 ]; then 14set -- autossh -- "$@" -t $SCRIPT
10 exec xterm -T "$host" -e \ 15
11 autossh "$host" -- -t $SCRIPT 16if [ "$DISPLAY" -a ! -t 0 ]
17then
18 exec xterm -T "$host" -e "$@"
12else 19else
13 exec \ 20 exec "$@"
14 autossh "$host" -- -t $SCRIPT
15fi 21fi