summaryrefslogtreecommitdiffstats
path: root/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc
blob: a07705411c2e4db31205b9aa7621948ea22f8aab (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/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/ /./g'`
fi

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
		break
	fi
done
dir=`dirname "$f"`

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"
if echo "$dir" | grep '^/' > /dev/null; then
	:
else
	dir=`pwd`/$dir
	PATH="$dir:$dir/$name:$dir/util:$PATH"
fi

SSL_VNC_BASEDIR="$dir"
export SSL_VNC_BASEDIR

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

exec ssl_tightvncviewer.tcl "$@"
OpenPOWER on IntegriCloud