Muchas gracias
Using perl Syntax Highlighting
!/usr/local/bin/perl
use Net::Telnet::Cisco;
my @ciscos = ({ip=>'1.1.1.1', user=>'test', pass=>'test1', root=>'root'});
for my $cisco (@ciscos) {
my $session = Net::Telnet::Cisco->new(Host => '$ip');
$session->login($cisco=>'$user', $cisco=>'$pass');
my @output;
#Enable mode
if($session->enable($cisco=>'$root')) {
$session->errmode(sub {die @_ unless $_[0] =~ /eof/});
@output = $session->cmd("reload\n\n");}
else {
warn "Can't enable: " . $session->errmsg;}
}
use Net::Telnet::Cisco;
my @ciscos = ({ip=>'1.1.1.1', user=>'test', pass=>'test1', root=>'root'});
for my $cisco (@ciscos) {
my $session = Net::Telnet::Cisco->new(Host => '$ip');
$session->login($cisco=>'$user', $cisco=>'$pass');
my @output;
#Enable mode
if($session->enable($cisco=>'$root')) {
$session->errmode(sub {die @_ unless $_[0] =~ /eof/});
@output = $session->cmd("reload\n\n");}
else {
warn "Can't enable: " . $session->errmsg;}
}
Coloreado en 0.003 segundos, usando GeSHi 1.0.8.4