I noticed that there was no screen script for ssh so I decided to use
the telnet screen script as a template for one.


#!/bin/bash
#
# Script for starting one or more ssh sessions
#

#
# Get the lts.conf entries, and assign them to shell
# variables.
#
eval `/bin/getltscfg -a`
#
# Get the IP address of the host to ssh into.
# First look for 'SSH_HOST', if not specified, then
# look for 'SERVER'. If that isn't specified, then use
# the default of '192.168.0.254'
#
# You need to supply a known_hosts file in 
# /opt/ltsp/i386/root/.ssh/known_hosts to keep it from 
# asking at every connect if you should connect to an
# unknown host.
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

#
# Clear the screen, to place cursor at the top
#
/usr/bin/clear

#
# Echo this message, telling user how to proceed.
#

echo -n "Screen:${TTY} ${SSH_HOST} username: "
read USER

#
# Launch the ssh program.
#
if [ $# -ge 1 ]; then
    SSH_ARGS=$*
else
    DEFAULT_SERVER=${SERVER:-"192.168.0.254"}
    SSH_HOST=${SSH_HOST:-${DEFAULT_SERVER}}
    SSH_ARGS="-q -l ${USER} ${SSH_HOST}"
fi

# Clear the screen for the password prompt
/usr/bin/clear

/bin/ssh ${SSH_ARGS}
#
# Brief pause, in case ssh had errors to report
#
echo -n "Please wait..."
/bin/sleep 1




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to