Copyright Michael Stefaniuc <mstefani@redhat.com> for Red Hat

Workaround for a race condition in CatOS' ssh implementation:
The problem with CatOS ssh is that it eats _sometimes_ the echoing of 
the last packet that made the connection to terminate. Most of the time
we get:
  Switch> (enable) exitConnection to switch.foo.bar closed by remote host.
which should never occur in the middle of a rancid run so we can ASSume
we finished the run correctly.

--- bin/cat5rancid.in.catos	Mon Jun 26 12:14:27 2006
+++ bin/cat5rancid.in	Mon Jun 26 12:16:35 2006
@@ -1059,7 +1059,7 @@
 ProcessHistory("COMMENTS","keysort","G0","!\n");
 TOP: while(<INPUT>) {
     tr/\015//d;
-    if (/> \(enable\) ?exit$/) {
+    if (/> \(enable\) ?exit(?:$|Connection)/) {
 	$clean_run=1;
 	last;
     }