]> thyrsus.com Git - ssh-installkeys.git/commitdiff
This version might work,
authorEric S. Raymond <esr@thyrsus.com>
Thu, 14 Dec 2006 04:21:42 +0000 (04:21 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 14 Dec 2006 04:21:42 +0000 (04:21 +0000)
sshauth

diff --git a/sshauth b/sshauth
index fd337d46570c716b57909eb238da66b402c547a3..e392614341bf040e8538c1c7cef5d106f5f58fc5 100755 (executable)
--- a/sshauth
+++ b/sshauth
@@ -169,16 +169,28 @@ fixperms .ssh
 if [ -x .ssh/authorized_keys ]
 then
     echo \"Remote authorized_keys file will not be overwritten.\"
-    echo \"To remove it, do 'sshauth -d ${user}@$host}'.\"
+    echo \"To remove it, do 'sshauth -d ${user}@${host}'.\"
     exit 1
+elif [ \$checkonly = 'yes' ]
+then
+    echo \"Remote .ssh exists, authorized_keys could be installed.\"
 else
     echo \"Creating remote .ssh/authorized_keys file...\"
+    cat >.ssh/authorized_keys <<EOF
+`cat $public_keys`
+EOF
 fi
 "
 
-if echo "$agent" | ssh -T ${quiet} ${user}@${host}
+if [ $check = 'yes' -a $verbose = '-v' ]
+then
+    echo "Here is the agent script that would be run:"
+    echo "$agent" 
+    exit 0
+elif echo "$agent" | ssh -T ${quiet} ${user}@${host}
 then
     echo "Installation or check successful."
+    exit 0
 else
     echo "Installation or check failed."
     exit 1