[SATLUG] Telnet Scripts?

Kase Saylor h_oudini at hotmail.com
Wed Mar 29 11:35:26 CST 2006


Thanks!! I appreciate everybody's help. "expect" works great.

Kase

>You can do this by using something called expect.
>    http://expect.nist.gov/
>
>In its simplest form, you create a bash script and automated via cron.  In
>that bash script, you call the expect script.  Something like this:
>
>-----------------
>#!/bin/bash
>
># Call the expect script
>/usr/local/sbin/myCiscoUpdaterTelnet.expect > /dev/null
>
>-----------------
>The expect script would look something like this (again this is just an
>oversimplified sample):
>
>-----------------
>#!/usr/local/bin/expect
>
>spawn telnet ciscoRouter
>send "yourRouterPassword\r"
>send "show config\r"
>send "\r"
>expect eof
>-----------------
>Regards
>
>-RH
>
>On Wednesday 29 March 2006 09:50, Kase Saylor wrote:
> > All,
> >
> > Is there a way to write a script that uses telnet? Basically I have a 
>Cisco
> > router that is configured via telnet, but instead of entering all of the
> > parameters by hand during a telnet session, I would like to write a 
>script
> > that will logon to the router, write all of the config data and then 
>exit.
> > Thanks for any help.
> >
> > Kase
>--
>_______________________________________________
>SATLUG mailing list
>SATLUG at satlug.org
>http://alamo.satlug.org/mailman/listinfo/satlug
>Powered by Rackspace (www.rackspace.com)




More information about the SATLUG mailing list