summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/vyatta-vtysh.pl9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/vyatta-vtysh.pl b/scripts/vyatta-vtysh.pl
index c1101b6d..3462feb0 100644
--- a/scripts/vyatta-vtysh.pl
+++ b/scripts/vyatta-vtysh.pl
@@ -61,7 +61,7 @@ sub log_it {
}
sub parse_cmdline {
- my $cmdline;
+ my $cmdline = "";
foreach my $arg (@ARGV) {
if (substr($arg, 0, 2) eq "-n") {
@@ -112,6 +112,9 @@ sub send_cmds_to_quagga {
return 0;
}
+sub usage {
+ print "usage: $0 [-n] -c \"<quagga command>\"\n";
+}
#
# main
@@ -119,6 +122,10 @@ sub send_cmds_to_quagga {
my ($cmdline, $rc);
$cmdline = parse_cmdline();
log_it($cmdline);
+if (! defined($cmdline) or $cmdline eq "") {
+ usage();
+ exit 1;
+}
$rc = send_cmds_to_quagga($cmdline);
exit $rc