diff options
Diffstat (limited to 'x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc')
-rwxr-xr-x | x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc | 85 |
1 files changed, 66 insertions, 19 deletions
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc b/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc index a077054..50e96b0 100755 --- a/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc +++ b/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc @@ -2,11 +2,11 @@ # # Copyright (c) 2006 by Karl J. Runge <runge@karlrunge.com> # -# ssl_vnc_gui: +# sslvnc: # -# A wrapper for ssl_tightvncviewer using a tcl/tk gui. +# A wrapper for ssvnc_cmd using a tcl/tk gui. # -# See ssl_tightvncviewer for details. +# See ssvnc_cmd for details. # if [ "X$XTERM_PRINT" != "X" ]; then XTERM_PRINT="" @@ -18,14 +18,25 @@ if [ "X$1" = "X-bg" ]; then exit 0 fi -PATH=$PATH:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin +PATH=$PATH:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin:/usr/sfw/bin:/usr/local/bin export PATH +if [ "X$WISH" = "X" ]; then + WISH=wish + for try in wish wish8.3 wish8.4 wish8.5 + do + if type $try > /dev/null; then + WISH=$try + break + fi + done +fi -SSL_VNC_GUI_CMD="$0 $*" -export SSL_VNC_GUI_CMD -SSL_VNC_LAUNCH=$SSL_VNC_GUI_CMD -export SSL_VNC_LAUNCH + +SSVNC_GUI_CMD="$0 $*" +export SSVNC_GUI_CMD +SSVNC_LAUNCH=$SSVNC_GUI_CMD +export SSVNC_LAUNCH # work out os.arch platform string and check for binaries: # @@ -50,13 +61,48 @@ do fi done dir=`dirname "$f"` +PATH="$dir:$PATH" -if [ ! -d "$dir/$name" ]; then - echo "cannot find platform dir: $dir/$name for your OS:" - uname -sm - echo "you can set the \$UNAME env. var. to override the setting." - exit 1 +nearby=0 +if [ -x "$dir/vncviewer" -a -x "$dir/stunnel" ]; then + nearby=1 fi +if [ ! -d "$dir/$name" -a $nearby = 0 ]; then + echo + echo "Cannot find platform dir for your OS `uname -sm`:" + echo + echo " $dir/$name" + echo + PATH=$PATH:/usr/sbin:/usr/local/sbin:/dist/sbin + + quit=0 + if type vncviewer >/dev/null 2>/dev/null; then + : + else + echo "vncviewer not found in PATH." + quit=1 + fi + if type stunnel >/dev/null 2>/dev/null; then + : + else + echo "stunnel not found in PATH." + quit=1 + fi + echo + if [ "X$quit" = "X1" ]; then + echo "You can set the \$UNAME env. var. to override the OS setting." + echo "Or, if available, run the ./build.unix script to build it." + echo "Or install external \"vncviewer\" and \"stunnel\" packages." + exit 1 + fi + echo "Using externel \"vncviewer\" and \"stunnel\" found in PATH." +else + STUNNEL_EXTRA_OPTS=${STUNNEL_EXTRA_OPTS:-"maxconn = 1"} + export STUNNEL_EXTRA_OPTS + SSVNC_VIEWER_INTERNAL=1 + export SSVNC_VIEWER_INTERNAL +fi + # Put our os.arch and other utils dirs at head of PATH to be sure to # pick them up: @@ -69,10 +115,11 @@ else PATH="$dir:$dir/$name:$dir/util:$PATH" fi -SSL_VNC_BASEDIR="$dir" -export SSL_VNC_BASEDIR +SSVNC_BASEDIR="$dir" +export SSVNC_BASEDIR -STUNNEL_EXTRA_OPTS=${STUNNEL_EXTRA_OPTS:-"maxconn = 1"} -export STUNNEL_EXTRA_OPTS - -exec ssl_tightvncviewer.tcl "$@" +if [ "X$WISH" = "Xwish" ]; then + exec ssvnc.tcl "$@" +else + exec $WISH $dir/util/ssvnc.tcl "$@" +fi |