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
#
# 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.
#
#
# Enter a loop, running telnet to the server.
#
if [ $# -ne 1 ]; then
echo "Usage: $0 <hostname or ip addr>"
exit 1
fi
#
# Set the terminal type, so that the remote host will
# have a clue what kind of terminal you are using.
#
export TERM=linux # Setup the terminal type
#
# Get this terminal name, to display on the top line of the screen
#
TTY=`/usr/bin/basename \`/usr/bin/tty\``
[ "${TTY}" = "console" ] && TTY="tty1" # Special case for first screen
REMOTE=$1
while :; do
#
# Clear the screen, to place cursor at the top
#
/usr/bin/clear
#
# Echo this message, telling user how to proceed.
#
echo -n "${TTY}, Press <enter> to establish a connection to the server..."
read CMD
#
# Clear the screen before launching telnet
#
/usr/bin/clear
#
# Launch the telnet program.
#
/usr/bin/telnet ${REMOTE}
#
# Brief pause, incase telnet had errors to report
#
/bin/sleep 2
done
|