X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=dell-switch.pl;h=33f1d1da3c16bc7bb4c1967e560048276fe01750;hb=a56c96a6ce1802160b2515f2cd3eac305a0b0ea6;hp=6ca957ba0c8532441007ddaeaf6105138ee701a9;hpb=3c38c3f1c28de7ddde6a2266a630d32d77de4531;p=dell-switch diff --git a/dell-switch.pl b/dell-switch.pl index 6ca957b..33f1d1d 100755 --- a/dell-switch.pl +++ b/dell-switch.pl @@ -116,6 +116,18 @@ while() { } } elsif ( $buff =~ m/% Unrecognized command/ ) { exit 1; + } elsif ( $buff =~ m/% Invalid input detected at .* marker/ ) { + + # try to rewrite command differences + + if ( $command =~ m/show lldp neighbors/ ) { + unshift @commands_while, 'show lldp remote-device all'; + undef $command; # don't save this command + $buff = ''; + } + + warn "# commands_while = ",dump( \@commands_while ); + } elsif ( $buff =~ s{More: , Quit: q.*One line: \s*}{} ) { send_pty " "; } elsif ( $buff =~ s{\Q--More-- or (q)uit\E}{} ) {