From 6b3e191272d2cd4aaf111dedd051b20d4a8d478f Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 24 Mar 2003 12:08:47 +0000 Subject: Correct argument passing, so help is shown even with only one option (as the error message suggests). --- mksshauth | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'mksshauth') diff --git a/mksshauth b/mksshauth index 8666702..83d6dd7 100755 --- a/mksshauth +++ b/mksshauth @@ -4,7 +4,7 @@ # Copyright 2000-2001 Juri Jensen # Copyright 2002 Juri Jensen & Jonas Smedegaard # -# $Id: mksshauth,v 1.4 2002-12-03 17:29:39 jonas Exp $ +# $Id: mksshauth,v 1.5 2003-03-24 12:08:47 jonas Exp $ # # Setup local and remote SSH for non-interactive authorization # @@ -13,15 +13,12 @@ set -e prg=`basename $0` -if [ $# \< 2 ]; then +if [ $# \< 1 ]; then echo "ERROR: Wrong arguments! (Use '$prg --help' for help)" exit 1 fi keytype=$1 -host=$2 shift -shift -options=$@ case "$keytype" in --help|-h) @@ -59,6 +56,10 @@ case "$keytype" in ;; esac +host=$1 +shift +options=$@ + if [ -n "$options" ]; then options="$options " fi -- cgit v1.2.3