Need help in some scripting related to router information gathering.
I have written script for gathering information from the router shown as below:
#!/bin/sh
USERID=
PWD=
PWD1=
dir=`pwd`
ip=
intface=
DATE=`date +'%m%d'`
Time=`date +'%H%M'`
(echo "$USERID";\
echo "$PWD";\
echo "en";\
echo "$PWD1";\
echo "sh ip cache flow";\
echo "q";\
sleep 30 )| telnet $ip > $dir/info$ip$DATE$Time.txt
But through this I can run only single command or set of commands in same file at one logging into router.
Can anyone help how to get the result from the router for different commands in different file without logging again and again into router?
|