foreach (split //, $string) {
print STDERR "[$_]" if $debug;
syswrite $pty, $_;
-# $pty->flush;
+ #$pty->flush;
+ sleep 0.05;
+
sysread $pty, my $echo, 1;
print STDERR $echo;
$buff .= $echo;
} elsif ( $buff =~ m/Password:/ ) {
send_pty "$passwd\n";
$buff = '';
+ } elsif ( $buff =~ m/\b([\w\-]+)>$/ ) {
+ send_pty "enable\n";
} elsif ( $buff =~ m/([\w\-]+)#$/ ) {
my $hostname = $1;
if ( $buff ) {
} elsif ( $buff =~ m/% Unrecognized command/ ) {
exit 1;
} elsif ( $buff =~ s{More: <space>, Quit: q.*One line: <return> }{} ) {
+ sleep 0.5;
send_pty " ";
+ } elsif ( $buff =~ s{\Q--More-- or (q)uit\E}{} ) {
+ send_pty " "
} elsif ( $buff =~ s{\e\[0m\r\s+\r}{} ) {
}
}
show arp
show vlan
show running-config
-show bridge address-table
+show bridge address