add SSH keys in interactive shells
This commit is contained in:
parent
a52f1bfcac
commit
22b18854c4
1 changed files with 8 additions and 4 deletions
4
zshrc
4
zshrc
|
|
@ -283,11 +283,15 @@ compinit
|
||||||
# 11. SSH Keychain
|
# 11. SSH Keychain
|
||||||
# ================
|
# ================
|
||||||
if is_interactive && command_exists keychain && [[ -d ~/.ssh ]]; then
|
if is_interactive && command_exists keychain && [[ -d ~/.ssh ]]; then
|
||||||
|
if command_exists keychain; then
|
||||||
keychain --nogui ~/.ssh/id_rsa*~*.pub(N)
|
keychain --nogui ~/.ssh/id_rsa*~*.pub(N)
|
||||||
KEYCHAINFILE="$HOME/.keychain/$(hostname)-sh"
|
KEYCHAINFILE="$HOME/.keychain/$(hostname)-sh"
|
||||||
if [[ -f $KEYCHAINFILE ]]; then
|
if [[ -f $KEYCHAINFILE ]]; then
|
||||||
source $KEYCHAINFILE >/dev/null
|
source $KEYCHAINFILE >/dev/null
|
||||||
fi
|
fi
|
||||||
|
elif command_exists ssh-add; then
|
||||||
|
ssh-add
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 12. rbenv and pyenv
|
# 12. rbenv and pyenv
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue