The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-13-2006
patil_reddy patil_reddy is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 2
Problem with logging into remote host

Hi All,

I am using a script for remotely logging into a rhost using telnet and shutdown a server. The script is as follows.

IP = 10.24.12.23; export IP
UNAME = username ; export UNAME
PWD = password; export PWD
CRDIR = /etc/rc.d/init.d ; export CRDIR

echo "logging into remote host"

(
telnet $IP << EOF
$UNAME # username for logging into rhost
$PWD # password for logging

cd $CRDIR
sh shutdown.sh stop # for shutdowning the server
$PWD # password for shutdowning the server

logout
EOF ) >> log.$$

When I execute this script, I am getting an error saying that "unknown host". Can you please let me know what the problem is? If you know any other way of logging into a remote host. Can you please let me know ASAP.

THanks in Advance,
Patil.