3
# For installation, put this file (qrouter.sh) in a standard executable path.
4
# Put startup script "qrouter.tcl" and shared library "qrouter.so"
5
# in ${QROUTER_LIB_DIR}.
7
# This script starts qrouter under the Tcl interpreter,
8
# reading commands from script qrouter.tcl which launches qrouter
9
# and retains the Tcl interactive interpreter.
11
# Parse for the argument "-noc[onsole]". If it exists, run qrouter
12
# without the TkCon console. Strip this argument from the argument list.
14
loclibdir=${QROUTER_LIB_DIR:=LIBDIR}
15
export QROUTER_LIB_DIR
20
if [ ${TERM:=""} = "cygwin" ]; then
21
export PATH="$PATH:$loclibdir"
22
export DISPLAY=${DISPLAY:=":0"}
25
# Don't use the console if "-noc[onsole]" was specified.
26
# Also, if "-i", "-h", or "-c" is specified, then this is
27
# a batch-mode operation and the console should be ignored.
43
exec ${loclibdir}/tkcon.tcl \
44
-eval "source ${loclibdir}/console.tcl" \
45
-slave "package require Tk; set argc $#; set argv [list $*]; \
46
source ${loclibdir}/qrouter.tcl"
50
# Run the stand-in for wish (qrouterexec), which acts exactly like "wish"
51
# except that it replaces ~/.wishrc with qrouter.tcl. This executable is
52
# *only* needed when running without the console; the console itself is
53
# capable of sourcing the startup script.
55
exec ${loclibdir}/qrouterexec -- $@