Telnet Script

I was wondering if anyone had a script that would telnet to the radio and pull the Hardware platform of multiple radios at the same time. and return the info along with the IP’s into a text file. I’m not a programmer so I don’t even know where to start with something like this.

Anyhelp would be greatly appreciated.

If you’re on linux…


#!/bin/sh
#
# autotel.sh username password host
#
# if you want multiple hosts, might I suggest
# something like:
#
# for host in cat hosts.file; do ./autotel.sh username password $host; done
#
# -or-
#
# ./autotel.sh username password “10.3.0.1 10.3.0.2 10.3.0.3 10.3.0.4”
#
# rjk - sept 2007
# reference: http://canopywireless.com/support/community/viewtopic.php?t=4393
password=${2:-admin}
username=${1:-admin}
host=${3}
logfile=/tmp/motorola.log


usage()
{
echo Usage: $0 username password host
exit
}


[ “$host” ] || usage


for host in ${host[@]}
do
echo "-------------------------------------------------------"
echo -n “Host: ${host} ->”
(
sleep 1
echo -e "${username}'r"
sleep 1
echo -e "${password}'r"
sleep 1
echo "version"
sleep 1
echo “exit”
) | telnet ${host} 2>/dev/null | grep Platform
done


http://www.techish.net/code/autotel.sh

Quick & dirty for ya…MANY MANY ways of doing this and I’m not saying mine is the right, or best way – but it works for me. =)

Ask and you shall recieve! Now thats service.

Hey RJK many thanks.

Do you know if that script work with SecureCRT?

Frothingdog.ca wrote:
Hey RJK many thanks.

Do you know if that script work with SecureCRT?


I don't see why not...provided the remote system you're connecting to has bash/telnet/grep

I can make you a Windows batch script if you want, it may take me 10 minutes because I'm rusty with Windows' `for' and `find'.

Ya a windows script that works with SecureCRT would be great.

Thanks