File: qrouter.sh.in

package info (click to toggle)
qrouter 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,296 kB
  • ctags: 991
  • sloc: ansic: 11,638; sh: 7,448; makefile: 105; tcl: 3
file content (57 lines) | stat: -rwxr-xr-x 1,529 bytes parent folder | download
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
#!/bin/sh
#
# For installation, put this file (qrouter.sh) in a standard executable path.
# Put startup script "qrouter.tcl" and shared library "qrouter.so"
# in ${QROUTER_LIB_DIR}.
#
# This script starts qrouter under the Tcl interpreter,
# reading commands from script qrouter.tcl which launches qrouter
# and retains the Tcl interactive interpreter.

# Parse for the argument "-noc[onsole]".  If it exists, run qrouter
# without the TkCon console.  Strip this argument from the argument list.

loclibdir=${QROUTER_LIB_DIR:=LIBDIR}
export QROUTER_LIB_DIR
QROUTER_WISH=WISH_EXE
export QROUTER_WISH

# Hacks for Cygwin
if [ ${TERM:=""} = "cygwin" ]; then
   export PATH="$PATH:$loclibdir"
   export DISPLAY=${DISPLAY:=":0"}
fi

# Don't use the console if "-noc[onsole]" was specified.
# Also, if "-i", "-h", or "-c" is specified, then this is
# a batch-mode operation and the console should be ignored.
TKCON=true
for i in $@ ; do
   case $i in
      -noc*)
	TKCON=
	shift
	;;
      -i* | -h* | -c* )
	TKCON=
	;;
   esac
done

if [ $TKCON ]; then

   exec /usr/bin/tkcon \
	-eval "source ${loclibdir}/console.tcl" \
	-slave "package require Tk; set argc $#; set argv [list $*]; \
	source ${loclibdir}/qrouter.tcl"
else

#
# Run the stand-in for wish (qrouterexec), which acts exactly like "wish"
# except that it replaces ~/.wishrc with qrouter.tcl.  This executable is
# *only* needed when running without the console; the console itself is
# capable of sourcing the startup script.
#
   exec ${loclibdir}/qrouterexec -- $@

fi