summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2022-02-24 10:51:58 -0500
committerAndrew Cady <d@jerkface.net>2022-02-24 10:51:58 -0500
commitbbef862f4b4c3e540f3be43ce1f9c44cc0e9ffb8 (patch)
tree54fc4efaa9f43969f6dfcfb4e2f89acf60c8c1ec
parente20447f68b3385a53f2585014632eedb814a4518 (diff)
remove (now unused) reverse connection code
-rwxr-xr-xdot/local/bin/xvnc52
1 files changed, 7 insertions, 45 deletions
diff --git a/dot/local/bin/xvnc b/dot/local/bin/xvnc
index e1e99a1..0a4f46c 100755
--- a/dot/local/bin/xvnc
+++ b/dot/local/bin/xvnc
@@ -6,6 +6,11 @@
6# The option is not be needed with latest x11vnc from source, but we don't rely 6# The option is not be needed with latest x11vnc from source, but we don't rely
7# on the remote side being up to date. 7# on the remote side being up to date.
8 8
9ssh()
10{
11 command ssh "$@" 2>&1 | sed 's/^/REMOTE> /'
12}
13
9direct_connection() 14direct_connection()
10{ 15{
11 port=$((5900 + ${local_display#*:})) 16 port=$((5900 + ${local_display#*:}))
@@ -20,32 +25,7 @@ direct_connection()
20 kill $pid 25 kill $pid
21} 26}
22 27
23quietly() 28share_display()
24{
25 "$@" # >/dev/null 2>&1
26}
27
28reverse_connection()
29{
30 d=${DISPLAY%.*}
31 d=${d#:}
32 port=$((5500 + d))
33 xvncviewer -v -fullscreen -encodings "copyrect tight zrle hextile" -listen &
34 pid=$!
35 quietly ssh -o ControlPath=none \
36 -R $port:localhost:$port \
37 ${remote_port:+-p $remote_port} \
38 "$remote_host" \
39 "set -x; x11vnc -noxrecord -q -nopw -localhost -display ${remote_display} -coe localhost:$port -rfbport 0 -v; echo \$?"
40 kill $pid
41}
42
43ssh()
44{
45 command ssh "$@" 2>&1 | sed 's/^/REMOTE> /'
46}
47
48share_display_direct()
49{ 29{
50 if [ "$DEBUG" ] 30 if [ "$DEBUG" ]
51 then 31 then
@@ -83,33 +63,15 @@ share_display_direct()
83 wait -n 63 wait -n
84} 64}
85 65
86share_display()
87{
88 set -x
89 port=5500
90 fuser -vk $port/tcp
91 ssh -o ControlPath=none \
92 -o ExitOnForwardFailure=yes \
93 -f \
94 -L $port:localhost:$port \
95 ${remote_port:+-p $remote_port} \
96 "$remote_host" \
97 "fuser -vk $port/tcp; DISPLAY=${remote_display} xvncviewer -fullscreen -encodings 'copyrect tight zrle hextile' -listen"
98 trap "fuser -vk $port/tcp" INT
99 sleep 1
100 x11vnc -noxrecord -q -nopw -localhost -display ${local_display} -coe localhost:$port -rfbport 0
101}
102
103if [ "$1" = -r ] 66if [ "$1" = -r ]
104then 67then
105 shift 68 shift
106 cmd=share_display_direct 69 cmd=share_display
107elif [ "$1" = -d ] 70elif [ "$1" = -d ]
108then 71then
109 shift 72 shift
110 cmd=direct_connection 73 cmd=direct_connection
111else 74else
112 # cmd=reverse_connection
113 cmd=direct_connection 75 cmd=direct_connection
114fi 76fi
115 77