summaryrefslogtreecommitdiff
path: root/mksshauth
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2003-03-24 12:08:47 +0000
committerJonas Smedegaard <dr@jones.dk>2003-03-24 12:08:47 +0000
commit6b3e191272d2cd4aaf111dedd051b20d4a8d478f (patch)
tree9724b58140e8f2e1ad7342aad8afb4ff509386b4 /mksshauth
parent8882580b208a6624934065e551d67f9d45fb24cd (diff)
Correct argument passing, so help is shown even with only one option (as the error message suggests).
Diffstat (limited to 'mksshauth')
-rwxr-xr-xmksshauth11
1 files changed, 6 insertions, 5 deletions
diff --git a/mksshauth b/mksshauth
index 8666702..83d6dd7 100755
--- a/mksshauth
+++ b/mksshauth
@@ -4,7 +4,7 @@
# Copyright 2000-2001 Juri Jensen <juri@xenux.dk>
# Copyright 2002 Juri Jensen <juri@xenux.dk> & Jonas Smedegaard <dr@jones.dk>
#
-# $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