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