diff options
Diffstat (limited to 'bin/brancid.in')
-rw-r--r-- | bin/brancid.in | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/brancid.in b/bin/brancid.in index 8cb3e69..59d168b 100644 --- a/bin/brancid.in +++ b/bin/brancid.in @@ -1,6 +1,6 @@ #! @PERLV_PATH@ ## -## $Id: brancid.in,v 1.21 2005/06/15 20:55:13 heas Exp $ +## $Id: brancid.in,v 1.22 2005/09/25 17:48:28 heas Exp $ ## hacked version of Hank's rancid - this one tries to deal with Bay's. ## ## Copyright (C) 1997-2004 by Terrapin Communications, Inc. @@ -22,7 +22,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'); @@ -201,6 +201,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 |