improve use of keychain
This commit is contained in:
parent
3c9c6bbd30
commit
133d39a065
1 changed files with 9 additions and 2 deletions
11
zsh/zshrc
11
zsh/zshrc
|
|
@ -379,6 +379,13 @@ compinit
|
|||
# ================
|
||||
# OS X includes keychain now, cool.
|
||||
if command_exists keychain; then
|
||||
keychain --nogui ~/.ssh/id_rsa ~/.ssh/id_rsa-dreamhost
|
||||
source "~/.keychain/$(hostname)-sh" >/dev/null
|
||||
if [[ -f ~/.ssh/id_rsa ]]; then
|
||||
keychain --nogui ~/.ssh/id_rsa
|
||||
elif [[ -f ~/.ssh/id_rsa-dreamhost ]]; then
|
||||
keychain --nogui ~/.ssh/id_rsa-dreamhost
|
||||
fi
|
||||
KEYCHAINFILE="$HOME/.keychain/$(hostname)-sh"
|
||||
if [[ -f $KEYCHAINFILE ]]; then
|
||||
source $KEYCHAINFILE >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue