aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-10-25 15:43:07 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-10-25 15:43:07 -0200
commit32ab57ed1e4412d2eba8200d9d1b45d6d78d613a (patch)
tree51cf875b8701f3f2e45aa6843ca293f036b3da1e
parent5e3520fdf0ce6c530896adbe4344bf497cd4fbd8 (diff)
downloadutils-ssh-32ab57ed1e4412d2eba8200d9d1b45d6d78d613a.tar.gz
utils-ssh-32ab57ed1e4412d2eba8200d9d1b45d6d78d613a.tar.bz2
Adds ssh-agent-loadkeys
-rwxr-xr-xssh-agent-loadkeys29
1 files changed, 29 insertions, 0 deletions
diff --git a/ssh-agent-loadkeys b/ssh-agent-loadkeys
new file mode 100755
index 0000000..5687ef6
--- /dev/null
+++ b/ssh-agent-loadkeys
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# Load keys into the ssh-agent
+# Uses monkeysphere and keychain
+#
+
+if ! ssh-add -l &> /dev/null; then
+ monkeysphere subkey-to-ssh-agent
+fi
+
+if [ -x '/usr/bin/keychain' ]; then
+ mkdir -p $HOME/.keychain
+
+ if [ -e "$HOME/.ssh/id_rsa" ]; then
+ /usr/bin/keychain -q $HOME/.ssh/id_rsa
+ fi
+
+ if [ -e "$HOME/.ssh/id_ed25519" ]; then
+ /usr/bin/keychain -q $HOME/.ssh/id_ed25519
+ fi
+
+ if [ -e "$HOME/.keychain/$HOSTNAME-sh" ]; then
+ . $HOME/.keychain/$HOSTNAME-sh
+ fi
+
+ if [ -e "$HOME/.keychain/$HOSTNAME-sh-gpg" ]; then
+ . $HOME/.keychain/$HOSTNAME-sh-gpg
+ fi
+fi