in reply to Re: Net Telnet Cisco
in thread Net Telnet Cisco
Regards, Scottmy $session = Net::Telnet::Cisco->new( Host => $switch, Prompt => '/.*#/', Input_log => "input.log", Output_log => "output.log", Timeout => 30); $session->always_waitfor_prompt; # Wait for the username prompt and enter username @out = $session->waitfor('/Username:.*$/'); print "@out\n"; @out = $session->print($user); print "@out\n"; # Wait for the password prompt and enter the password @out = $session->waitfor('/Password:.*$/'); print "@out\n"; @out = $session->print($password); print "@out\n"; @out = $session->cmd("copy tftp start\n$tftp_server\n$config_file\n$de +st_file\n"); print "@out\n"; @out = $session->cmd("reload\n\n"); print "@out\n"; @out = $session->close;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Net Telnet Cisco
by spivey49 (Monk) on Jul 22, 2008 at 18:17 UTC | |
|
Re^3: Net Telnet Cisco
by spickles (Scribe) on Jul 22, 2008 at 18:11 UTC | |
|
Re^3: Net Telnet Cisco
by karavelov (Monk) on Jul 22, 2008 at 18:51 UTC | |
by spickles (Scribe) on Jul 24, 2008 at 02:24 UTC | |
by Anonymous Monk on Jul 18, 2012 at 16:25 UTC |