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.