From 1cc9f22072de1d314a67387aac57740fb25c5258 Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Thu, 4 May 2006 21:40:56 +0000 Subject: Imported from rancid-2.3.2a4.tar.gz. --- bin/cat5rancid.in | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'bin/cat5rancid.in') diff --git a/bin/cat5rancid.in b/bin/cat5rancid.in index c79fc91..ca2ae36 100644 --- a/bin/cat5rancid.in +++ b/bin/cat5rancid.in @@ -1,6 +1,6 @@ #! @PERLV_PATH@ ## -## $Id: cat5rancid.in,v 1.44 2005/08/14 01:04:07 heas Exp $ +## $Id: cat5rancid.in,v 1.45 2005/09/25 17:48:29 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'); @@ -1051,6 +1051,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 -- cgit