aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-03-25 22:33:18 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-03-25 22:33:18 -0300
commite9820ca672d714e68df6e5d0ccaa98c00f9ef554 (patch)
treef34883a1461d54925845497dfb04f9165fe2daad
parent3ff87b60e90f4a917838eb847c60ecfd43b150a8 (diff)
downloadutils-ssh-e9820ca672d714e68df6e5d0ccaa98c00f9ef554.tar.gz
utils-ssh-e9820ca672d714e68df6e5d0ccaa98c00f9ef554.tar.bz2
Honor MONKEYSPHERE_SUBKEYS_FOR_AGENT env variable
-rwxr-xr-xssh-agent-loadkeys14
1 files changed, 9 insertions, 5 deletions
diff --git a/ssh-agent-loadkeys b/ssh-agent-loadkeys
index fe79552..81dfe1b 100755
--- a/ssh-agent-loadkeys
+++ b/ssh-agent-loadkeys
@@ -22,11 +22,15 @@ if [ -x '/usr/bin/keychain' ]; then
#fi
# Check for monkeysphere
- #if [ -x '/usr/bin/monkeysphere' ]; then
- # if ! ssh-add -l &> /dev/null && [ "`gpg --list-secret-keys | wc -l`" != "0" ]; then
- # monkeysphere subkey-to-ssh-agent
- # fi
- #fi
+ if [ -x '/usr/bin/monkeysphere' ]; then
+ #if ! ssh-add -l &> /dev/null && [ "`gpg --list-secret-keys | wc -l`" != "0" ]; then
+ # From MONKEYSPHERE(1): "The MONKEYSPHERE_SUBKEYS_FOR_AGENT environment can be used to specify the full
+ # fingerprints of specific keys to add to the agent (space separated), instead
+ # of adding them all."
+ if [ ! -z "$MONKEYSPHERE_SUBKEYS_FOR_AGENT" ]; then
+ monkeysphere subkey-to-ssh-agent
+ fi
+ fi
# Check for RSA key
if [ -e "$HOME/.ssh/id_rsa" ]; then