diff options
Diffstat (limited to 'x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_tightvncviewer')
-rwxr-xr-x | x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_tightvncviewer | 62 |
1 files changed, 48 insertions, 14 deletions
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_tightvncviewer b/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_tightvncviewer index 8472853..3f0de56 100755 --- a/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_tightvncviewer +++ b/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_tightvncviewer @@ -36,6 +36,10 @@ # -grab # # +# If the *very first* argument is "-cotvnc" then it is assumed you are on +# Darwin and want to run the Chicken of the VNC viewer via our wrapper. +# +# # See the TightVNC viewer documentation for on its cmdline arguments. # # For convenience, here is the current (7/2006) TightVNC viewer -help output: @@ -73,7 +77,7 @@ # if [ "X$1" = "X-h" -o "X$1" = "X-help" -o "X$1" = "X--help" ]; then - head -70 "$0" | grep -v bin/sh + head -76 "$0" | grep -v bin/sh exit fi @@ -84,26 +88,44 @@ export PATH # Set this for ssl_vncviewer to pick up: # -VNCVIEWERCMD="vncviewer" -export VNCVIEWERCMD +use_ours=0 +if [ "X$1" = "X-cotvnc" ]; then + shift + DARWIN_COTVNC=1 + export DARWIN_COTVNC +fi +if [ "X$VNCVIEWERCMD" = "X" ]; then + VNCVIEWERCMD="vncviewer" + export VNCVIEWERCMD + if [ "X$DARWIN_COTVNC" = "X" ]; then + use_ours=1 + fi +fi # work out os.arch platform string and check for binaries: # name=$UNAME if [ "X$name" = "X" ]; then - name=`uname -sm | sed -e 's/ /./'` + name=`uname -sm | sed -e 's/ /./g'` fi -if [ -L "$0" ]; then - d=`dirname "\`ls -l "$0" | sed -e 's/^.* -> //'\`"` - if echo "$d" | grep '^/' > /dev/null; then - dir="$d" +f="$0" +for t in 1 2 3 4 5 +do + if [ -L "$f" ]; then + f0="$f" + f=`ls -l "$f" | sed -e 's/^.* -> //'` + if echo "$f" | grep '^/' > /dev/null; then + : + else + f="`dirname "$f0"`/$f" + fi else - dir="`dirname "$0"`/$d" + break fi -else - dir=`dirname "$0"` -fi +done +dir=`dirname "$f"` + if [ ! -d "$dir/$name" ]; then echo "cannot find platform dir: $dir/$name for your OS:" uname -sm @@ -115,10 +137,22 @@ fi # pick them up: # PATH="$dir:$dir/$name:$dir/util:$PATH" +if echo "$dir" | grep '^/' > /dev/null; then + : +else + dir=`pwd`/$dir + PATH="$dir:$dir/$name:$dir/util:$PATH" +fi STUNNEL_EXTRA_OPTS=${STUNNEL_EXTRA_OPTS:-"maxconn = 1"} export STUNNEL_EXTRA_OPTS -# Force the use of tight encoding for localhost redir connection: +# If ours (and not cotvnc), force the use of tight encoding for localhost +# redir connection: # -ssl_vncviewer "$@" -encodings 'copyrect tight zrle zlib hextile' +# +if [ $use_ours = 1 ]; then + ssl_vncviewer "$@" -encodings 'copyrect tight zrle zlib hextile' +else + ssl_vncviewer "$@" +fi |