File: start_telnet

package info (click to toggle)
ltsp 0.99debian11%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 972 kB
  • ctags: 103
  • sloc: sh: 1,320; python: 485; ansic: 436; lex: 152; makefile: 129; yacc: 58
file content (43 lines) | stat: -rwxr-xr-x 1,040 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
#
# Copyright (c) 2002 by James A. McQuillan (McQuillan Systems, LLC)
#
# This software is licensed under the Gnu General Public License version 2,
# the full text of which can be found in the COPYING file.
#

#
# Script for starting one or more telnet sessions
#

. /etc/ltsp_functions

#
# Get the IP address of the host to telnet into.
# First look for 'TELNET_HOST', if not specified, then
# look for 'SERVER'. If that isn't specified, then use
# the default of '192.168.0.254'
#
TELNET_HOST=`get_cfg TELNET_HOST`
[ -z "${TELNET_HOST}" ] && TELNET_HOST=`get_cfg SERVER 192.168.0.254`

#
# See how many TELNET sessions to run for this workstation.
# If not specified, use a default of 2 sessions.
#
TELNET_SESSIONS=`get_cfg TELNET_SESSIONS 2`

SCREEN_NO=2
while [ ${SCREEN_NO} -le ${TELNET_SESSIONS} ]; do
    #
    # Start a session
    #
    /bin/open -c ${SCREEN_NO} -- /bin/telnet_loop ${TELNET_HOST}

    SCREEN_NO=`expr ${SCREEN_NO} + 1`
done

#
# Now, run the telnet on the main screen
#
/bin/telnet_loop ${TELNET_HOST}