Subject: | Patch for support EdgeCore devices |
EdgeCore L2 devices tries to emulate Cisco IOS CLI,
but does this a bit incorrectly.
My 3-lines patch fixes behaviour of enable() function.
Subject: | Net-Telnet-Cisco.pm.edgecore-enable.patch |
--- Cisco.pm.orig 2002-06-18 21:17:03.000000000 +0400
+++ Cisco.pm 2008-10-03 14:21:57.000000000 +0400
@@ -555,6 +555,7 @@
-match => '/[Uu]sername[:\s]*$/',
-match => '/[Pp]assw(?:or)?d[:\s]*$/',
-match => '/(?i:Passcode)[:\s]*$/',
+ -match => '/^\x0A\x0D.+/',
-match => "/$old_prompt/",
) or do {
return &$error("read eof waiting for enable login or password prompt")
@@ -582,6 +583,8 @@
} elsif ($match =~ /$old_prompt/) {
## Success! Exit the block.
last;
+ } elsif ($match =~ /^\x0A\x0D(.+)/) {
+ last if $1 =~ /$old_prompt/;
} else {
return &$error("enable received unexpected prompt. Aborting.");
}