diff options
author | Tar Committer <tar@ocjtech.us> | 2004-01-12 03:17:26 +0000 |
---|---|---|
committer | Tar Committer <tar@ocjtech.us> | 2004-01-12 03:17:26 +0000 |
commit | 989312339ea2e16579803a48700628c5469e327a (patch) | |
tree | 967ee77195819d70f2dc675444e92340bb98e0d6 /bin/hrancid.in | |
parent | ff168ecfe045c690c24d5bbc5a3062bf9d64120c (diff) | |
download | rancid-989312339ea2e16579803a48700628c5469e327a.tar.gz rancid-989312339ea2e16579803a48700628c5469e327a.tar.xz rancid-989312339ea2e16579803a48700628c5469e327a.zip |
Imported from rancid-2.3.rc1.tar.gz.rancid-2.3.rc1
Diffstat (limited to 'bin/hrancid.in')
-rw-r--r--[-rwxr-xr-x] | bin/hrancid.in | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/bin/hrancid.in b/bin/hrancid.in index d0bcc55..fa048ce 100755..100644 --- a/bin/hrancid.in +++ b/bin/hrancid.in @@ -1,29 +1,33 @@ -#!@PERLV_PATH@ +#! @PERLV_PATH@ ## -## Amazingly hacked version of Hank's rancid - this one tries to -## deal with HP procurves. +## $Id: hrancid.in,v 1.17 2004/01/11 03:49:13 heas Exp $ ## -## Copyright (C) 1997-2001 by Henry Kilmer. +## Copyright (C) 1997-2004 by Terrapin Communications, Inc. ## All rights reserved. ## -## This software may be freely copied, modified and redistributed without -## fee for non-commerical purposes provided that this copyright notice is -## preserved intact on all copies and modified copies. +## This software may be freely copied, modified and redistributed +## without fee for non-commerical purposes provided that this license +## remains intact and unmodified with any RANCID distribution. ## ## There is no warranty or other guarantee of fitness of this software. -## It is provided solely "as is". The author(s) disclaim(s) all +## It is provided solely "as is". The author(s) disclaim(s) all ## responsibility and liability with respect to this software's usage ## or its effect upon hardware, computer systems, other software, or ## anything else. ## +## Except where noted otherwise, rancid was written by and is maintained by +## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz. ## # +# Amazingly hacked version of Hank's rancid - this one tries to +# deal with HP procurves. +# # RANCID - Really Awesome New Cisco confIg Differ # # usage: rancid [-d] [-l] [-f filename | $host] # use Getopt::Std; -getopts('dflm'); +getopts('dfl'); $log = $opt_l; $debug = $opt_d; $file = $opt_f; @@ -334,7 +338,7 @@ sub WriteTerm { ProcessHistory("","","",";$_") && next; - # the rest are from rancid (ie: cisco), but suspect they will someday + # the rest are from rancid (i.e.: cisco), but suspect they will someday # be applicable or close to it. /^tftp-server flash / && next; # kill any tftp remains @@ -493,8 +497,12 @@ TOP: while(<INPUT>) { } while (/#\s*($cmds_regexp)\s*$/) { $cmd = $1; - if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+)/)[0]; - $prompt .= "[#>]"; } + if (!defined($prompt)) { + $prompt = ($_ =~ /^([^#]+)/)[0]; + $prompt =~ s/([][}{)(\\])/\\$1/g; + $prompt .= "[#>]"; + print STDERR ("PROMPT MATCH: $prompt\n") if ($debug); + } print STDERR ("HIT COMMAND:$_") if ($debug); if (! defined($commands{$cmd})) { print STDERR "$host: found unexpected command - \"$cmd\"\n"; |