Hi,
Using Linux 5 . A change in the script which will take a input file which has servername,port. As telnet was not going into the next item in the file, i used curl instead of telnet. This works. However i am not able to get the output of the script write into the log file properly. I will have to see if i can get the output which only displays in the console be printed in the output.log file.
Input to the file is : serverlist.txt
tibserver001,9640
tibserver004,9642
Script is :trytelnet.sh -->
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo " $0 server list"
exit 1
fi
serverlist=$1
OUT=output.log
rm $OUT > /dev/null 2>&1
while IFS=, read HOST PORT
do
echo -e "\n\n======================================================================================\n\n"
echo Working on $HOST
echo "Checking $HOST on Port $PORT"
curl $HOST:$PORT --verbose >> $OUT
echo -e "\n\n======================================================================================\n\n"
done < $serverlist