From 1a7c45398738cdb4eaafdc9e0962272f19d54816 Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Tue, 5 Dec 2006 16:52:12 +0000 Subject: Imported from rancid-2.3.2a6.tar.gz. --- bin/francid.in | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'bin/francid.in') diff --git a/bin/francid.in b/bin/francid.in index bda031f..2967a34 100644 --- a/bin/francid.in +++ b/bin/francid.in @@ -1,7 +1,8 @@ #! @PERLV_PATH@ ## -## $Id: francid.in,v 1.39 2006/07/12 23:43:14 heas Exp $ +## $Id: francid.in,v 1.42 2006/10/05 05:43:31 heas Exp $ ## +## @PACKAGE@ @VERSION@ ## Copyright (C) 1997-2006 by Terrapin Communications, Inc. ## All rights reserved. ## @@ -24,10 +25,14 @@ # # RANCID - Really Awesome New Cisco confIg Differ # -# usage: rancid [-d] [-l] [-f filename | hostname] +# usage: rancid [-dV] [-l] [-f filename | hostname] # use Getopt::Std; -getopts('dfl'); +getopts('dflV'); +if ($opt_V) { + print "@PACKAGE@ @VERSION@\n"; + exit(0); +} $log = $opt_l; $debug = $opt_d; $file = $opt_f; @@ -148,7 +153,7 @@ sub ShowVersion { while () { tr/\015//d; next if /^\s*$/; - last if(/^$prompt/); + last if (/^$prompt/); next if (/^(The system |Crash time)/); next if (/^((Active|Standby) Management|LP Slot \d+) uptime is/); @@ -201,6 +206,10 @@ sub ShowChassis { if (/temperature:/i) { $skip = 1; } + s/(Fan \d+ \S+), speed .*/$1/; + if (/speed/i) { + $skip = 1; + } next if $skip; ProcessHistory("CHASSIS","","","! $_"); @@ -215,8 +224,8 @@ sub ShowFlash { while () { tr/\015//d; - last if(/^$prompt/); - next if /^\s*$/; + last if (/^$prompt/); + next if (/^\s*$/); ProcessHistory("FLASH","","","!Flash: $_"); } ProcessHistory("","","","!\n"); @@ -229,9 +238,10 @@ sub ShowModule { while () { tr/\015//d; - last if(/^$prompt/); - next if /^\s*$/; - next if /:\s*$/; + last if (/^$prompt/); + return(1) if (/Invalid input ->/); + next if (/^\s*$/); + next if (/:\s*$/); ProcessHistory("MODULE","","","!Module: $_"); } ProcessHistory("","","","!\n"); @@ -244,7 +254,7 @@ sub WriteTerm { while () { tr/\015//d; - last if(/^$prompt/); + last if (/^$prompt/); /Current configuration:/i && next; /^ver \d+\.\d+/ && next; -- cgit