One little change - please just look at the first part of the script I
sent in (see below), I just realized how royally screwed up the rest of
the script is right now, and I should be embarassed at letting it get
out into the public....

> 
> #!/usr/bin/perl -w
> 
> # Program for logging into Foundry and Cisco switches/routers
> #  and backing up specific information
> 
> use strict;
> use Net::Telnet;
> my ($ipaddr, $logfile, @command_out);
> 
> $ipaddr = "10.1.1.4";
> $logfile = "testlog.log";
> @command_out = ("sh ver", "sh tech");
> 
> &start;
> 
> sub start {
> 
>       package Start;
>       my ($t, @output, $prompt);
>       
>       ## Setup new connection and login
>       $t = new Net::Telnet;
>       $t->open("$ipaddr");
> 
>       &login;
> 
>       ## Opens Logfile for writing
>       open (OUTPUT, ">$logfile") || die "blah";
> 
>       ## Start the backup
>       $prompt = '/.*[#>]$/';
>       foreach (@command_out) {
>               @output = $t->cmd(String => $_, Prompt => $prompt);
>               print OUTPUT @output;
>       };
> };
> 
> sub Start::login {
>       my ($passwd, $en);
>       $passwd = "mypasswd";
>       $en = "en";
>       $Start::t->waitfor('/password/i');    ##### this is line 39
>       $Start::t->print($passwd);
>       $Start::t->print($en);
>       $Start::t->waitfor('/password/i');
>       $Start::t->print($passwd);
> };

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to