From efda41ee6705200aa2dfd76542a55de53f0f0a33 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 13 Oct 2019 20:44:12 -0400 Subject: xvnc bugfix --- dot/local/bin/xvnc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'dot/local/bin') diff --git a/dot/local/bin/xvnc b/dot/local/bin/xvnc index 7c0159c..9378254 100755 --- a/dot/local/bin/xvnc +++ b/dot/local/bin/xvnc @@ -5,7 +5,7 @@ direct_connection() port=$((5900 + local_display)) ssh -o ControlPath=none -n \ -L $port:localhost:$port \ - ${remote_port+-p $remote_port} \ + ${remote_port:+-p $remote_port} \ "$remote_host" \ "x11vnc -nopw -ncache -ncache_cr -localhost -display ${remote_display}" & pid=$! @@ -26,7 +26,7 @@ reverse_connection() pid=$! quietly ssh -o ControlPath=none \ -R $port:localhost:$port \ - ${remote_port+-p $remote_port} \ + ${remote_port:+-p $remote_port} \ "$remote_host" \ "x11vnc -q -nopw -localhost -display ${remote_display} -coe localhost:$port -rfbport 0" kill $pid @@ -41,7 +41,7 @@ share_display() -o ExitOnForwardFailure=yes \ -f \ -L $port:localhost:$port \ - ${remote_port+-p $remote_port} \ + ${remote_port:+-p $remote_port} \ "$remote_host" \ "fuser -vk $port/tcp; DISPLAY=${remote_display} xvncviewer -fullscreen -encodings 'copyrect tight zrle hextile' -listen" trap "fuser -vk $port/tcp" INT @@ -59,9 +59,13 @@ fi remote_host=${1:-blackboard} -remote_port=${remote_host##*:} -remote_host=${remote_host%:*} - +case "$remote_host" in + *:*) remote_port=${remote_host##*:} + remote_host=${remote_host%:*} + ;; + *) remote_port= + ;; +esac remote_display=${2:-:0} local_display=${3:-:0} -- cgit v1.2.3