summaryrefslogtreecommitdiffstats
path: root/bin/xrancid.in
diff options
context:
space:
mode:
authorTar Committer <tar@ocjtech.us>2006-05-04 21:40:56 +0000
committerTar Committer <tar@ocjtech.us>2006-05-04 21:40:56 +0000
commit1cc9f22072de1d314a67387aac57740fb25c5258 (patch)
treef59aa9d622175580add0923bfac8963dc946e98e /bin/xrancid.in
parentc0482931956d127b5f09d4a8d72758cd4cb1f097 (diff)
downloadrancid-1cc9f22072de1d314a67387aac57740fb25c5258.tar.gz
rancid-1cc9f22072de1d314a67387aac57740fb25c5258.tar.xz
rancid-1cc9f22072de1d314a67387aac57740fb25c5258.zip
Imported from rancid-2.3.2a4.tar.gz.rancid-2.3.2a4
Diffstat (limited to 'bin/xrancid.in')
-rw-r--r--bin/xrancid.in15
1 files changed, 12 insertions, 3 deletions
diff --git a/bin/xrancid.in b/bin/xrancid.in
index 718c699..80e7e5b 100644
--- a/bin/xrancid.in
+++ b/bin/xrancid.in
@@ -1,6 +1,6 @@
#! @PERLV_PATH@
##
-## $Id: xrancid.in,v 1.37 2005/06/15 20:54:41 heas Exp $
+## $Id: xrancid.in,v 1.39 2006/03/23 18:43:01 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -21,7 +21,7 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-d] [-l] [-f filename | hostname]
#
use Getopt::Std;
getopts('dfl');
@@ -391,6 +391,15 @@ sub DoNothing {print STDOUT;}
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -448,7 +457,7 @@ TOP: while(<INPUT>) {
if (!defined($prompt)) {
$prompt = ($_ =~ /^([^#]+#)/)[0];
$prompt =~ s/([][}{)(\\])/\\$1/g;
- $prompt =~ s/:(\d+ ?)#/:\\d+ ?#/;
+ $prompt =~ s/[:.](\d+ ?)#/:\\d+ ?#/;
$prompt =~ s/\*/\\\*/;
print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
}