Exit from Telnet

From: Marco Greene (marco_greene@hotmail.com)
Date: Mon Feb 03 2003 - 14:41:18 EST


Hello Admins,

 

I have 2 servers server1 and server2, where the regular users should only
have access

to a menu - not dollar prompt.

The users can telnet only into server1 and from here they get the menu
like this:

1. Please type 1 for server1

2. Please type 2 for server2

9. Exit

 

And here is the .profile on server1 for the user:

trap "" 1 2 3

  echo " ** 1 = to access menu on server1 **"
  echo " ** 2 = to access menu on server2 **"
  echo " ** 9 = to LOGOFF **"
  echo " ** **"
  echo " ***************************************************"
  echo "\n"
  echo " Please enter your choice: \c"

  reply=`line`

  if [ $reply = 1 ]
    then
      echo "\n"
      echo " You have chosen to access server1 application"
      . /server1_application
     
      reply=9

  elif [ $reply = 2 ]
    then
      echo "\n"
      echo " You have chosen to access server2 application"
      telnet server2
      reply=9

  elif [ $reply = 9 ]
    then
      echo "\n"
      echo " You have chosen to LOGOFF."
      echo "\n Have a nice day..."
      exit
  fi
done

If the user types 2

the menu is doing a telnet to server2 where the user gets

server2_application program.

Here comes my problem. When the user exits from server2 he gets

dollar prompt into server1.

What I want instead is the user to exit for good from any server - either
server1

or server2 once he exits from server2, or at least to get into a manu but

not dollar prompt.

The .profile has

trap "" 1 2 3

at the begining on both server1 and server2.

Any help will be appreciated.

TIA,

Marco

------------------------------------------------------------------------

Protect your PC - Click here for McAfee.com VirusScan Online
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:45 EDT