summaryrefslogtreecommitdiffstats
path: root/bin/jerancid.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/jerancid.in')
-rw-r--r--bin/jerancid.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/jerancid.in b/bin/jerancid.in
index 7455b1d..656da3c 100644
--- a/bin/jerancid.in
+++ b/bin/jerancid.in
@@ -1,6 +1,6 @@
#! @PERLV_PATH@
##
-## $Id: jerancid.in,v 1.33 2005/06/15 20:54:41 heas Exp $
+## $Id: jerancid.in,v 1.34 2005/09/25 17:48:30 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -23,7 +23,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');
@@ -554,6 +554,15 @@ sub DoNothing {print STDOUT;}
$jnxe_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