diff options
author | Andrew Cady <d@jerkface.net> | 2022-02-24 10:51:58 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2022-02-24 10:51:58 -0500 |
commit | bbef862f4b4c3e540f3be43ce1f9c44cc0e9ffb8 (patch) | |
tree | 54fc4efaa9f43969f6dfcfb4e2f89acf60c8c1ec | |
parent | e20447f68b3385a53f2585014632eedb814a4518 (diff) |
remove (now unused) reverse connection code
-rwxr-xr-x | dot/local/bin/xvnc | 52 |
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 | ||
9 | ssh() | ||
10 | { | ||
11 | command ssh "$@" 2>&1 | sed 's/^/REMOTE> /' | ||
12 | } | ||
13 | |||
9 | direct_connection() | 14 | direct_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 | ||
23 | quietly() | 28 | share_display() |
24 | { | ||
25 | "$@" # >/dev/null 2>&1 | ||
26 | } | ||
27 | |||
28 | reverse_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 | |||
43 | ssh() | ||
44 | { | ||
45 | command ssh "$@" 2>&1 | sed 's/^/REMOTE> /' | ||
46 | } | ||
47 | |||
48 | share_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 | ||
86 | share_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 | |||
103 | if [ "$1" = -r ] | 66 | if [ "$1" = -r ] |
104 | then | 67 | then |
105 | shift | 68 | shift |
106 | cmd=share_display_direct | 69 | cmd=share_display |
107 | elif [ "$1" = -d ] | 70 | elif [ "$1" = -d ] |
108 | then | 71 | then |
109 | shift | 72 | shift |
110 | cmd=direct_connection | 73 | cmd=direct_connection |
111 | else | 74 | else |
112 | # cmd=reverse_connection | ||
113 | cmd=direct_connection | 75 | cmd=direct_connection |
114 | fi | 76 | fi |
115 | 77 | ||