summaryrefslogtreecommitdiffstats
path: root/bin/francid.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/francid.in')
-rw-r--r--bin/francid.in30
1 files changed, 20 insertions, 10 deletions
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 (<INPUT>) {
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 (<INPUT>) {
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 (<INPUT>) {
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 (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
+ last if (/^$prompt/);
/Current configuration:/i && next;
/^ver \d+\.\d+/ && next;