summaryrefslogtreecommitdiffstats
path: root/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_vnc_gui
blob: abdb2d3230a0c2757eddd98acabd763b4a738a13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
#
# Copyright (c) 2006 by Karl J. Runge <runge@karlrunge.com>
#
# ssl_vnc_gui:
#
#    A wrapper for ssl_tightvncviewer using a tcl/tk gui.
#
# See ssl_tightvncviewer for details.
#
if [ "X$XTERM_PRINT" != "X" ]; then
	XTERM_PRINT=""
	cat > /dev/null
fi
if [ "X$1" = "X-bg" ]; then
	shift
	$0 "$@" &
	exit 0
fi

PATH=$PATH:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin
export PATH

SSL_VNC_GUI_CMD="$0 $*"
export SSL_VNC_GUI_CMD
SSL_VNC_LAUNCH=$SSL_VNC_GUI_CMD
export SSL_VNC_LAUNCH

# work out os.arch platform string and check for binaries:
#
name=$UNAME
if [ "X$name" = "X" ]; then
	name=`uname -sm | sed -e 's/ /./'`
fi

if [ -L "$0" ]; then
	d=`dirname "\`ls -l "$0" | sed -e 's/^.* -> //'\`"`
	if echo "$d" | grep '^/' > /dev/null; then
		dir="$d"
	else
		dir="`dirname "$0"`/$d"
	fi
else
	dir=`dirname "$0"`
fi
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
fi

# Put our os.arch and other utils dirs at head of PATH to be sure to
# pick them up:
#
PATH="$dir:$dir/$name:$dir/util:$PATH"

SSL_VNC_BASEDIR="$dir"
export SSL_VNC_BASEDIR

STUNNEL_EXTRA_OPTS=${STUNNEL_EXTRA_OPTS:-"maxconn = 1"}
export STUNNEL_EXTRA_OPTS

exec ssl_tightvncviewer.tcl "$@"